Archaeological remains can determine that it was inhabited during the time of the Romans.
The medieval village was established in 1153, after the conquest of Siurana. Was granted a town charter in 1159. Archbishop Espàrec de la Barca (1215) boosted its population, ordering build the castle, the first church and the city wall. The castle became the summer residence of the Archbishops of Tarragona.
Had suffered several attacks during the Catalan Revolt. On January 12, 1641 the town was attacked by the troops of Josep Margarit. In 1642 was attacked by Marshal La Mothe that turned the people as a base of operations. In 1649, after a siege of two days, the city fell to the troops of Juan de Garay. The church and castle were destroyed.