The underground city of Ouyi (Noushabad) in the northern
Kashan -
Isfahan province - is considered one of the masterpieces of ancient architecture.
The main reason underground city of Noushabad was carved stemmed from the fact that in the past this region was quite insecure and by forming an underground chain of passages beneath the entire city, the inhabitants would shelter there in the time of being attacked.
And also through these passages they could reach any spot of the city without being seen. The depth of this underground city varies from 4 to 18 meters and the different spaces formed by carving the rocks seem a little scary! To reach the underground city there were several different openings.
some of these openings were located inside the houses of people and some others were located in important gathering places such as the main fort just outside the city.
People could live in the underground passages and room for several days without the need of going outside. There are three levels in this underground city and these levels were cleverly planned in a way that going to the different levels required
...see more moving from down to up.
This made it easier for the people sheltering in the underground city to prevent enemies from getting to the upper levels. Another interesting feature of their architecture was the curvy passages that made it possible for the inhabitants to ambush enemies.
Furthermore there were several other tricks that were used to resist against the enemies, for instance digging deep holes in the middle of the rooms and covering it with rotating stones that would fall down if anyone stepped on them.
Noushabad is located about 5 kilometers north of Kashan.
Reference:
http://en.wikipedia.org/wiki/Nushabad