Balaguer’s castle has been known as Formós Castle since the Middle Ages. We know the date of its founding thanks to the historian Ibn Hayyan, who collected the tale of de Isa b. Ahmad al-Rasi regarding the events that took place in the Upper March of Al-Andalus in 284 of the Hegira (897-898 AD): "Isa b. Ahmad states: in this year of the Lord of the Upper Frontier Lubb b. Ahmad al - Qasi attacked Aura Castle in the demarcation of Barcelona, headquarters of the forthright usurper. Lubb took the castle, burned it and caused the enemy harm. When he met the Count of this region, Anqadid ibn al-Mundir (Guifré el Pelós), father of Sunyer, he forced him to flee, dispersed his troops and that day, in a fight, dealt the usurper Anqaded a blow that killed him a few days later. God showed in him the great favour he has for Muslims! The son of Anqadid, Sunyer -who God curses - inherited his father’s dignity. In this year, in the month of Ramadan (October 897 AD), Lubb b. Muhammad began construction of hisn Balagi (Balaguer Castle) in the districts of faraway Lérida."
In the mid-11th century, a palace was built in its interior that was decorated with refined stylized plant motifs rendered on plaster and polychrome. The main decoration is based on plant and geometric motifs. Epigraphic strips are also rendered, on which fragments of the Quran can be seed, along with zoomorph motifs such as a harpy with hands or a bird.
Few of us know about the layout of the palace rooms, except that a pool irrigated a garden area near a gallery of polylobulate and profusely decorated arch curves that would look towards the zone of the River Segre.
With the conquest in the early 12th century, the Counts of Urgel occupied the ancient palace and turned it into their residence. In the 14th centuries, large renovation works were executed that contributed to the conversion of the entire northern zone into the great garden irrigated by ceramic channels built with tiles manufactured by Moorish artisans in Manises-Paterna, which gave the new spaces an air of stylistic continuity with the Al Andalus ancient palace.
Balaguer Castle was destroyed in 1413 as a result of the war between the last Count of Urgel, James II and King Fernando I of Antequera.