Marca Hispanica
After the fall of the Western Roman Empire, it was part of the Visigoth kingdom. Barbastro and the Barbitaniya area were overtaken by Musa bin Nusair in 717, as part of the Ummayad push to conquer northern states of the Marca Hispanica and the name Madyar was given to the town.