Sultan Muhammad Quli Qutub Shah, the 5th ruler of the Qutb Shahi dynasty built Charminar in 1591 shortly after he had shifted his capital from Golkonda to nearby Hyderabad. He built this famous structure to commemorate the elimination of a plague epidemic from this city. He is said to have prayed for the end of a plague that was ravaging his city and vowed to build a masjid (Islamic mosque) at the very place where he was praying. In 1591 while laying the foundation of Charminar, Quli prayed: "Oh Allah, bestow unto this city peace and prosperity. Let millions of men of all castes, creeds and religions make it their abode, like fish in the water." The Mosque became popularly known as Charminar because of its four (Persian/Hindi char = four) minarets which was possibly was to honour the first four caliphs of Islam.