The Ria Formosa lagoon attracted humans from the Palaeolithic age until the end of prehistory. The first settlements date from the fourth century BC, during the period of Phoenician colonization of the western Mediterranean. At the time, the area was known as Ossonoba, and was the most important urban centre of southern Portugal and commercial port for agricultural products, fish, and minerals.
Between the second and eighth centuries, the city was under the domain of the Romans, then the Byzantines, and later Visigoths, before being conquered by the Moors in 713. From the third century onwards and during the Visigothic period, it was the site of an Episcopal see, the Ancient Diocese of Ossonoba (306-688). The Byzantine presence has endured in the city walls' towers that were built during the Byzantine period.
With the advent of Moorish rule in the eighth century, Ossonoba retained its status as the most important town in the southwest corner of the Iberian Peninsula.In the 9th century, it became the capital of a short-lived princedom and was fortified with a ring of defensive walls. At this time, in the 10th century, the name Santa Maria (Shantamariyyat al-Gharbin Arabic) began to be used instead of Ossonoba. By the 11th century, the town was known as Santa Maria Ibn Harun.
During the 500 years of Moorish rule, some Jewish residents of Faro made written copies of the Old Testament. One of Faro's historical names in Arabic is أخشونبة (ʼUḫšūnubaḧ). The Moors were defeated and expelled in 1249 by the forces of the Portuguese King Afonso III. With the decline of the importance of the city of Silves (which was made the regional bishopric as Diocese of Silves shortly during and properly after the Reconquista), Faro took over the role of administration of the Algarve area.