Udaipur was founded in 1559, by Maharana Udai Singh II in the fertile circular Girwa Valley to the southwest of Nagda, on the Banas River. The city was established as the new capital of the Mewar kingdom. This area already had a thriving trading town, Ayad, which had served as capital of Mewar in the 10th through 12th centuries. The Girwa region was thus already well-known to Chittaud rulers who moved to it whenever the vulnerable tableland Chittaurgarh was threatened with enemy attacks. Maharana Udai Singh II, in the wake of 16th century emergence of artillery warfare, decided during his exile at Kumbhalgarh to move his capital to a more secure location. Ayad was flood-prone, hence he chose the ridge east of Pichola Lake to start his new capital city, where he came upon a hermit while hunting in the foothills of the Aravalli Range. The hermit blessed the king and guided him to build a palace on the spot, assuring him it would be well protected. Udai Singh II consequently established a residence on the site. In November 1567, the Mughal emperor Akbar laid siege to the venerated fort of Chittor. To protect Udaipur from External attacks, Maharana Udai Singh built a six kilometre long city wall, with seven gates,namely Surajpole, Chandpole, Udiapole, Hathipole. Ambapole, Brahmpole and so on. The area within these walls and gates is still known as the old city or the walled city.