The village and the castle was founded by the Moors and rebuilt by the Knights Templar and transformed into a fortress-monastery, after the conquest of 1153. It is considered to be the largest fortified complex in Catalonia[citation needed], and one of the best examples of Romanesque, religious and military, architecture of the Templar order in the whole Western world.[citation needed]