While primitive human occupation of their site dates back to prehistoric times and is mentioned in the writings of Ptolemy and Polybius, in the middle of the second century BC, its fortifications date of the Roman invasion of the Iberian Peninsula, possibly due to the acquired importance in the regional scenario . This was the place chosen by Julius Caesar to formalize peace with the Lusitanos (49), after which was renamed Pax Julia, been host of the three jurisdictions Roman Lusitania. It is believed that the Romans defensive walls date back to sometime between the third century and the fourth century.
This economic and strategic importance remained at the time of the Swabians, the Visigoths and under Muslim occupation.
At the time of the Christian Reconquest of the Iberian Peninsula, was first conquered by the forces of King Afonso Henriques (1112-1185) in 1159, to be abandoned four months later. It was retaken by surprise by an expedition of popular Ides of Santarém, in early December 1162.
In the years that followed, after the defeat of that sovereign in the siege of Badajoz (1169), the rider Gonçalo Mendes da Maia – the Lidador since nonagenarian, lost his life in the defense of the walls of Beja. Given the lack of information about the period after that date, the researchers believe that the major offensive Almohad Abu Yusuf Ya’qub al-Mansur (1191) to the Tagus river, having regained Silves, also understood the reconquest of Beja, remaining in the hands of Christians only Évora, in the Alentejo. It is assumed also that the village would have returned to Portuguese hands only between 1232 and 1234, a time when the surrounding Moura, Serpa and Aljustrel documented to be returned.