The village is located in the north east of the province, at the foot of the mountains of the Sierras Beticas, where the Cadiz countryside begins, and the Rivers Guadalete and Sarracin flow through an area which is essentially devoted to dry region crops.
It dates back to the Neolithic period, but its present-day distribution around Matrera Castle was not established until the Middle Ages. The village stands on the two slopes of a hill and features a number of noble houses, such as Topete Mansion, as well as the whitewashed houses typical of the white villages.
Inhabited since Prehistoric times, as proven by the dolmens at Alberite, declared Property of Cultural Interest by the Andalusian Regional Government.
At the beginning of the 8th century, the land on which the village stands today fell into the hands of the Moslem conquerors, who built Matrera Castle in order to defend it; this fortress was captured by the Christians in 1342 and granted, along with its territories, to the city of Seville by King Alfonso XI.
The village's history began in earnest in the 16th century, which saw the start of a lawsuit between the inhabitants of Villamartin and Seville council which was finally resolved in 1818, when the village's lands and compensation for the produce reaped from the Campo de Matrera area over a period of 300 years were awarded to the people of Villamartin, although this sentence benefitted a small group of villagers to the detriment of the rest.