The St. Mary Magdalene's Church, dating from the middle of the 13th century, originally served as the parish church for the Hungarian citizens of the town (the Mátyás Church was for the use of the town’s German citizens). During the 14th and 15th centuries it was enlarged several times. During the first-half of the Turkish occupation it remained the only Christian church in the Castle; during the second-half it was converted into a mosque. Following the defeat of the Turks in 1686 it was given back to the Franciscan Order, who demolished most of the church except for the tower, and used the stones to build a new single-nave church, in the Baroque style. As a result of the damage sustained by the church during the 2nd World War, the nave was demolished and only the Gothic style tower was restored. The ruins behind the church have been used to form an exhibition of the history of the church. In 1792 Emperor Francis I, King of Hungary, was crowned in the church.
References:The Château de Foix dominates the town of Foix. An important tourist site, it is known as a centre of the Cathars. Built on an older 7th-century fortification, the castle is known from 987. In 1002, it was mentioned in the will of Roger I, Count of Carcassonne, who bequeathed the fortress to his youngest child, Bernard. In effect, the family ruling over the region were installed here which allowed them to control access to the upper Ariège valley and to keep surveillance from this strategic point over the lower land, protected behind impregnable walls.
In 1034, the castle became capital of the County of Foix and played a decisive role in medieval military history. During the two following centuries, the castle was home to Counts with shining personalities who became the soul of the Occitan resistance during the crusade against the Albigensians.