The Bahmani Kingdom, or the Bahmani Sultanate, was a late medieval Persianate kingdom that ruled the Deccan Plateau in India. The first independent Muslim sultanate of the Deccan, the Bahmani Kingdom came to power in 1347 during the rebellion of Ismail Mukh against Muhammad bin Tughlaq, the Sultan of Delhi. Ismail Mukh then abdicated in favour of Zafar Khan, who established the Bahmani Sultanate.
The Bahmani Kingdom was perpetually at war with its neighbours, including its rival to the south, the Vijayanagara Empire, which outlasted the sultanate. The Mahmud Gawan Madrasa was created by Mahmud Gawan, the vizier regent of the sultanate from 1466 until his execution in 1481, during a conflict between the foreign (Afaqis) and local (Deccanis) nobility. Bidar Fort was built by Ahmad Shah I (r. 1422–36), who relocated the capital to the city of Bidar. Ahmad Shah led campaigns against Vijayanagara and the sultanates of Malwa and Gujarat. His campaign against Vijayanagara in 1423 included a siege of the capital, ending in the expansion of the Sultanate. Mahmud Gawan would later lead campaigns against Malwa, Vijayanagara, and the Gajapatis, and extended the sultanate to its maximum extent.