Myoryuji Temple (妙立寺, Myōryūji), commonly known as Ninjadera ("Ninja Temple"), was built by the Maeda lords, rulers over the region during the Edo Period. While not actually associated with ninja, the temple earned its nickname because of its many deceptive defences.
Since the shogun imposed strict building restrictions as one way of weakening his regional lords, Myoryuji was designed to circumvent the restrictions and serve as a disguised military outpost. It was built with considerable defences and escape routes, so that its defenders could alert the castle in the event of an attack.
The temple's defences aimed to guard against intruders or attack, and include hidden tunnels, secret rooms, traps, and a labyrinth of corridors and staircases. These can be viewed by guided tour (reservations recommended) held in Japanese, although good English guidebooks are available.
Myoryuji is located in the Teramachi District in the south of the city. Populated by numerous temples, this area was originally located outside of the city limits as were the entertainment districts.