Melilla is a Spanish city and an exclave located on the north coast of Africa, sharing a border with Morocco with an area of . Melilla, along with Ceuta, is one of two permanently inhabited Spanish cities in mainland Africa. It was part of Málaga province until 14 March 1995, when the city's Statute of Autonomy was passed.
Melilla, like Ceuta, was a free port before Spain joined the European Union. As of 2011 it had a population of 78,476 made up of Christians, Muslims (chiefly Riffians), and a small number of Jews. Both Spanish and Riffian are widely spoken, with Spanish as the only official language.
Melilla was a Phoenician and later Punic establishment under the name of Rusadir (Rusaddir for the Romans and Ryssadeiron for the Greeks). Later it became a part of the Roman province of Mauretania Tingitana. As centuries passed, it went through Vandal, Byzantine and Hispano-Visigothic hands. The political history is similar to that of towns in the region of the Moroccan Rif and southern Spain. Local rule passed through Amazigh, Phoenician, Punic, Roman, Umayyad, Idrisid, Almoravid, Almohad, Marinid, and then Wattasid rulers. Melilla was part of the Kingdom of Fez when the Catholic Monarchs, Queen Isabella I of Castile and King Ferdinand II of Aragon requested Juan Alfonso Pérez de Guzmán, 3rd Duke of Medina Sidonia, to take the city.
In the Conquest of Melilla, the duke sent Pedro Estopiñán, who conquered the city virtually without a fight in 1497, a few years after Castile had taken control of the Nasrid Kingdom of Granada, the last remnant of Al-Andalus, in 1492. Melilla was immediately threatened with reconquest and was besieged during 1694–1696 and 1774–1775. One Spanish officer reflected, "an hour in Melilla, from the point of view of merit, was worth more than thirty years of service to Spain."
The current limits of the Spanish territory around the fortress were fixed by treaties with Morocco in 1859, 1860, 1861, and 1894. In the late 19th century, as Spanish influence expanded, Melilla became the only authorised centre of trade on the Rif coast between Tetuan and the Algerian frontier. The value of trade increased, goat skins, eggs and beeswax being the principal exports, and cotton goods, tea, sugar, and candles being the chief imports.
In 1908 two companies, under the protection of Bou Hmara, a chieftain then ruling the Rif region, started mining lead and iron some 20 kilometres from Melilla. A railway to the mines was begun. In October of that year the Bou Hmara's vassals revolted against him and raided the mines, which remained closed until June 1909. By July the workmen were again attacked and several of them killed. Severe fighting between the Spaniards and the tribesmen followed, in the Second Melillan campaign.
In 1910, the Rif having submitted, the Spaniards restarted the mines and undertook harbour works at Mar Chica, but hostilities broke out again in 1911. In 1921 the Berbers under the leadership of Abd el Krim inflicted a grave defeat on the Spanish (see Battle of Annual), and were not defeated until 1926, when the Spanish Protectorate finally managed to control the area again.
General Francisco Franco used the city as one of his staging grounds for his Nationalist rebellion in 1936, starting the Spanish Civil War. A statue of him – the last statue of Franco in Spain – is still prominently featured.
On 6 November 2007, King Juan Carlos I and Queen Sofia visited the city, which caused a massive demonstration of support. The visit also sparked protests from the Moroccan government. It was the first time a Spanish monarch had visited Melilla in 80 years.
Melilla (and Ceuta) have declared the Muslim holiday of Eid al-Adha or Feast of the Sacrifice, as an official public holiday from 2010 onwards. It is the first time a non-Christian religious festival is officially celebrated in Spain since the Reconquista.