The citadel of Mdina was fortified from as long ago as 1000 BC when the Phoenicians built a protective wall and called their settlement Malet, meaning 'place of shelter'. The Romans built a large town here and called it Melita. It was given its present name when the Arabs arrived in the 9th century – medina is Arabic for 'walled city'. They built strong walls and dug a deep moat between Mdina and its surrounding suburbs (rabat in Arabic).

In medieval times Mdina was called Cittá Notabile – the Noble City. It was the favoured residence of the Maltese aristocracy and the seat of the universitá (governing council). The Knights of St John, who were largely a sea-based force, made Grand Harbour and Valletta their centre of activity, and Mdina sank into the background as a holiday destination for the nobility.