There is no documented history of the municipality until the XV century, although it is believed that due to its location between the provinces of Malaga and Granada, the abundance of water, wildlife refuges in the mountains and the Roman origin of its name, Compita-Orum, which is Latin for "crossroads" it was home to some human settlements, but, for the moment there are no traces which confirms this.
The first document which mentions Cómpeta dated the 29th of April, 1487 by the surrender of the villages in the area to the Catholics Monarchs. The area was populated by Muslims who were dedicated mainly to the olive, vine and raising silkworms. After the expulsion of the Moors in 1609 and the division of their lands to Christian settlers arrived mostly from La Roda, Sevilla, Puente Genil and Steppe, began to increase the population of the town and the production of the land distributed to settlers.
In the XVIII century, achieved a growing area of over 1,000 acres dedicated to vines for raisins and wine and rainfed cereal cultivation. The expansion continued until the end of XIX century, when it sank into an economic crisis due to several factors: a cholera epidemic that decimated the population the previous year, 1884, an earthquake destroyed much of the town and a plague of phylloxera wiped out most of vineyards. By mid-century XX begins to rise again due to land development, cultivation of vineyards and the emergence of tourism, arriving to the XXI century with a rather positive view.