The Phoenicians from Tyre founded the city as Malaka about 770 BC. The name Malaka or mlk is probably derived from the Phoenician word for "salt" because fish was salted near the harbor.
After a period of Carthaginian rule, Malaka became part of the Roman Empire. In its Roman stage, the city (Latin name, Malaca) showed a remarkable degree of development. Transformed into a confederated city, it was under a special law, the Lex Flavia Malacitana. A Roman theatre was built at this time.After the fall of the Western Roman Empire, it was ruled first by the Visigoths and then by the Byzantine Empire (550-621).
In the 8th century, during the Muslim Arabic rule over Spain, the city became an important trade center. Málaga was first a possession of the Caliphate of Córdoba. After the fall of the Umayyad dynasty, it became the capital of a distinct kingdom ruled by the Zirids. During this time, the city was called Mālaqah From 1025 it was the capital of the autonomous Taifa of Málaga, until its conquest by the Taifa of Granada in 1057.
The traveller Ibn Battuta, who passed through around 1325, characterised it as "one of the largest and most beautiful towns of Andalusia [uniting] the conveniences of both sea and land, and is abundantly supplied with foodstuffs and fruits". He praised its grapes, figs, and almonds; "its ruby-coloured Murcian pomegranates have no equal in the world." Another exported product was its "excellent gilded pottery". The town's mosque was large and beautiful, with "exceptionally tall orange trees" in its courtyard.
Málaga was one of the Iberian cities where Muslim rule persisted the longest, having been part of the Emirate of Granada. While most other parts of the peninsula had already succumbed to the reconquista, the medieval Christian Spanish struggled to drive the Muslims out. Málaga was conquered by Christian forces on 18 August