Located to the north of the Bay of Cádiz, its municipal area is composed of flat land and coast, in which we must highlight its extensive beaches and dune formations, in addition to the fishing corrals, enclosures prepared for an ancient form of fishing and characteristic of the area.
The village, although it may have a Phoenician origin, acquired the character of a town during the Muslim era and in the Christian conquest. In it we can find many elements of interest such as the Castillo de Luna, the Church of Nuestra Señora de la O and the Chapel of San Juan Bautista.
It seems to have a Tartessian origin, although it was identified with the Phoenician city of Astaroth or frontier fort. During Roman rule there must have been an alfar for the manufacture of amphoras to be used in the transport of salted fish from Cádiz.
In the Muslim era a ribat or monastery called Robota Ruta was created, around it a population nucleus settled.
Conquered by the Christians in 1264, it was ceded (1295) by Sancho IV to Alonso Pérez de Guzmán, known as “el Bueno”, warden of Tarifa, in recognition of his military exploits. Before long, it would go to the Casa de Arcos. This dependency will disappear, in the first half of the 19th century, with the dissolution in Spain of the seigniorial regime.
In 1702 it would be looted by an Anglo-Dutch army that destroyed many of its monuments. In 1811 he was sacked again, this time by French troops.
In its term there is, since 1953, an Air Naval Base used jointly by the United States and Spain.