The Ria Formosa lagoon attracted human occupants from the Palaeolithic age until the end of pre-history. During that time a settlement grew up – Ossonoba – which was an important town during the period of Roman occupation and, according to historians, the forerunner of present-day Faro. From the 3rd century onwards and during the Visigothic period it was the site of an Episcopal see.
With the advent of Moorish rule in the 8th 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 the name Santa Maria began to be used instead of Ossonoba. Later on the town was known as Harun (from a local Muslim chieftain), hence its current name, Faro. During the 500 years of Moorish rule there were some Jewish inhabitants in Faro who wrote copies of the Old Testament. One of Faro's historical names in Arabic is أخشونبة (ʼUḫšūnubaḧ). The Moors were defeated by the forces of the Portuguese King Afonso III in 1249. With the decline of the importance of the city of Silves, Faro took over the role of administration of the Algarve area.
The Earl of Essex sacked the town in 1596 and seized the library of the Bishop of Faro. These books were later donated to the University of Oxford, becoming part of the Bodleian Library.
Lagos had become the capital of the historical province of Algarve in 1577 and remained so until 1756, the year following the destruction of much of the town by the 1755 Lisbon earthquake. The earthquake damaged several areas in the Algarve, where a tsunami dismantled some coastal fortresses and, in the lower levels, razed houses. Almost all the coastal towns and villages of the Algarve were heavily damaged, except Faro, which was protected by the sandy banks of Ria Formosa lagoon. Since then Faro has been the administrative seat of the region.