Mdina, once Malta’s capital, has a rich history dating back to pre-Roman times. Until the 16th century, Mdina and Rabat were the island's most populated areas, offering water-rich valleys. During Roman times, Mdina, then called Melita, was five times larger. The Arabs renamed it Mdina in 870 AD, but little remains from their era aside from a Muslim cemetery near the Domus Romana.
Under Norman rule (11th-12th centuries), Malta shifted to Christianity. By 1432, King Alfonso of Spain called Mdina a "jewel." Mdina declined after the Knights of St. John established Valletta as the new capital.
Information was from : https://mt.wikipedia.org/wiki/L-Imdina . I just simplified in a few words