The city of Gulbarga was founded by the Bahmani Sultans in the 14th century as their capital. The northern Deccan, including the district of Gulbarga, passed under control of the Sultanate of Delhi. The revolt of the officers appointed from Delhi resulted in founding of the Bahmani Sultanate in 1347 by Hassan Gangu, who chose Gulbarga (Ahsenabad during this period) to be his capital. Gulbarg`s old moated fort is in a much deteriorated state, but it has a number of interesting buildings inside including the Jama Masjid, reputed to have been built by a Moorish architect during the late 14th or early 15th century who imitated the great mosque in Cordoba, Spain.