Muslims ruled the region briefly until king Alfonso I of Asturias (739–757) retook the region in the Reconquista. The comarca of Valdeorras was depopulated after its capture by Alfonso I as part of the Desert of the Duero, a buffer zone he created between Asturias and the Muslim states. During the reign of Ordoño I of Asturias (850–866) the re-population of the uninhabited zone began. The people who descended the mountains of the north for the uninhabited valleys were called foramontanos: meaning "out of the mountains." A Rúa, also known as San Esteban de La Rúa during the Middle Ages, was the historical capital of Valdeorras. The region was under the successive rule of the Kingdom of Asturias, Kingdom of Galicia, Kingdom of Leon and the Crown of Castile.