Sultan Quli, a governor of Golkonda, revolted against the Bahmani Sultanate and established the Qutb Shahi dynasty in 1518; he rebuilt the mud-fort of Golconda and named the city "Muhammad nagar". The fifth sultan, Muhammad Quli Qutb Shah, established Hyderabad on the banks of the Musi River in 1591, to avoid the water shortages experienced at Golkonda. During his rule, he had the Charminar and Mecca Masjid built in the city. On 21 September 1687, the Golkonda Sultanate came under the rule of the Mughal emperor Aurangzeb after a year-long siege of the Golkonda fort. The annexed area was renamed Deccan Suba (Deccan province) and the capital was moved from Golkonda to Aurangabad, about 550 km (342 mi) northwest of Hyderabad.

What position did Sultan Quli hold?