The Order of Saint James was founded in the Kingdom of León circa 1170, probably as an order of Augustinian canons regular to escort pilgrims to the shrine of St. James the Greater in Santiago de Compostela. But King Ferdinand II of León soon set it to garrison the southern frontiers of León against the Almohads of al-Andalus. In 1170, Ferdinand II granted the new order the castles of Cáceres and Monfragüe, which had been confiscated from Gerald the Fearless in 1169, and would make further donations thereafter.