Myōryū-ji

Myōryū-ji (妙立寺), commonly known as Ninja-dera ("Ninja Temple"), is a Buddhist temple belonging to Nichiren sect located in the city of Kanazawa, Ishikawa, Japan. While not actually associated with ninjas, the temple earned its nickname because of its many deceptive defences.

History
In 1585 Maeda Toshiie, the founding daimyō of Kaga Domain, built a chapel within Kanazawa Castle as a prayer place of Kaga Domain. In 1643, Maeda Toshitsune, the third daimyō of Kaga Domain, relocated the chapel to a new site in the Tera-machi district to the south of the castle, and ordered the construction of a full temple. The temple layout and location were part of the domain's defensive plans against a possible attack by the central government (Tokugawa shogunate).

Since the Edo period Tokugawa shogunate imposed strict building restrictions as one way of weakening his regional lords, Myōryū-ji was designed to circumvent the restrictions and serve as a disguised military outpost. It was supplemented with considerable defensive features and escape routes, so that its defenders could alert the castle in the event of an attack. These included hidden tunnels, secret rooms, traps, and a labyrinth of corridors and staircases.

Features
The Tokugawa shogunate prohibited construction of buildings higher than three stories. Viewed from the outside, the temple appears to be a two-story building, but actually it is a four-story building with seven-layer internal structure.

The temple is built around a central water well which is approximately 25 m deep; the bottom of the well is said to connect to a tunnel to Kanazawa Castle. The main building has a complicated layout which includes a middle floor and middle-middle floor, and contains 23 rooms and 29 staircases. There are different contrivances to fool the enemy such as hidden chambers and stairs, completely unexpected and reversible trap-like doors and floors, secret tunnels, escape pits. The lookout on the top affords a view of the surrounding area. In addition, the temple walls and roof are very strong and durable enough to withstand typhoons and heavy snow.