Bangalore ( BANG-gə-lor, -LOR), officially Bengaluru (Kannada pronunciation: [ˈbeŋgɐɭuːɾu] ), is the capital and largest city of the southern Indian state of Karnataka. It has a population of more than 8 million and a metropolitan population of around 15 million, making it India's third most populous city and fourth most populous urban agglomeration. It is the most populous city and largest urban agglomeration in South India, and is the 27th largest city in the world. Located on the Deccan Plateau, at a height of over 900 m (3,000 ft) above sea level, Bangalore has a pleasant climate throughout the year, with its parks and green spaces earning it the reputation of India's "Garden City". Its elevation is the highest of India's major cities.The city's history dates back to around 890, as per the old Kannada stone inscription found at the Nageshwara Temple in Begur, Bangalore. In 1537, Kempé Gowdā, a feudal ruler under the Vijayanagara Empire, established a mud fort, considered the foundation of modern Bangalore and its oldest areas, or pétés, which still exist. After the fall of the Vijayanagara Empire, Kempe Gowda declared independence; in 1638, a large Adil Shahi Bijapur army defeated Kempe Gowda III, and Bangalore came under Shahaji Bhonsle as a jagir, which later became his capital. The Mughals later captured Bangalore and sold it to Maharaja Devaraja Wodeyar II of the Kingdom of Mysore. When Haider Ali seized control of the kingdom, Bangalore's administration passed into his hands. The city was captured by the British East India Company after victory in the Fourth Anglo-Mysore War (1799), which then returned administrative control of the city, along with the kingdom, to Maharaja Krishnaraja Wadiyar III. The old city developed under the dominions of the maharaja.