The only still operating Catholic Church of the Castle District looks back on an eventful history. Originally, it was constructed to be a parish church, and by its title it was always outstanding among the churches of Buda. Its significance increased to a national level in the second half of the 19th century when it became a crowning cathedral. Today it is known as Matthias Church, this title however only originates from the 19th century when the coat-of-arms of King Matthias I. of 1470 was discovered on the tower. Despite the romantic story of this nomenclature, the original and still respected patron saint of the cathedral is the Virgin Mary.
A royal diploma from 1255 refers to the church as yet to be completed, while another diploma from 1269 calls it newly erected. Though originally it was designed to be a parish church, the town community could not fully practice their rights over it, since the church's founder King Béla IV bestowed the right of presentation to the Dominican sisters' monastery, which was established on Hare Island (today: Margit Island) where the king's daughter Margit used to live.
The size of the first church building was almost identical to the one that is standing today, including the entrance, the three naves dissected by two rows of pillars, the chancel with a polygonal apse and chancel aisles with square termination. The original church building had the arrangement of a cathedral: a transept is placed in front of the triumphal arch, and two towers are raised on the western facade.
During the Middle Ages, the Church of Our Lady served the purpose of a parish church for the town's German citizens. When the town was founded, the majority of the town's inhabitants were German, therefore it was natural that the community had their own church. (The Hungarian community established their own chapels within the parish: the Maria Magdalena and the Saint Peter churches.) The fact that the royal court often visited the church only increased its significance. As early as the 14th century it was customary to lay out the king's body in the Church of Our Lady before his funeral. It is also worthy of note, that in 1444, following János Hunyadi's victorious campaign in the Balkans the captured flags were placed in the church, furthermore, that both of King Matthias' weddings were held here.
The church underwent a significant re-building at the beginning of the 15th century. It was turned into a hall church, therefore the side-walls were lifted and mullioned windows with tracery were made at the southern side. The chancel aisles were lengthened and expanded right to the end of the choir. At southern side of the church a new, ornamented gate, the so-called Maria Gate was opened, which is a unique piece of art of the architectural sculpture of Buda. At the finishing stage of the construction, chapels were placed by the side of the church, both of which were completed by 1433: one sepulchral chapel of the Garai baronial family to the north, and another sepulchral chapel to the south, which belonged to Johann Ellenpeck, a citizen of Buda. An annex was built to the southern side of the church, which supposedly was to serve as the royal oratory. This is when the reconstruction of the southern tower, which collapsed in 1384, and the construction of the northern tower, began. King Matthias' coat-of-arms was placed on the southern tower in 1470.
The Turkish conquest brought the medieval parish church's days of glory to an end. In 1541 Suleiman II - under whose leadership the town was occupied, - ordered the removal of altars and seats from the church. To make the conquest obvious the Sultan held his Friday prayers here. The church, which was turned into a Muslim place of worship, was from this point on referred to as Büjük (Great), Eszki (Old) or Suleiman khan djami. Apart from these changes, there were no other alterations implemented on the church building by the Turkish occupiers.
The cathedral had a lucky escape from the destruction wrought during the wars of the Turkish era, and survived the re-occupation of the town, in 1686 in relatively good condition. Following the re-occupation, the Franciscans, who arrived with the besieging troops, were the first to occupy the church. However, a royal order made them hand over the church to the Jesuit Order in 1687. The Jesuits soon repaired the building and richly decorated its interior. They constructed their monastery directly at the northern side of the church, and established a seminary on the south. Following the dispersal of the Jesuit Order (1773), the right of presentation over the parish church was again taken over by the town council. Much of the church's fittings were lost during this time, as they were put up to auction in 1785, on the order of Emperor Joseph II. To emphasize the historical importance of the Austrian-Hungarian Compromise of 1867, Emperor Franz Joseph and his wife Queen Elisabeth were crowned Hungarian king and queen in the Church of Our Lady in a splendid ceremony.
The deteriorating condition of the church, which required immediate attention, was noticed during these glorious events. The architect, Frigyes Schulek won the tender for the church's restoration, and renovated the building between 1874 and 1896 according to purist conservation methods common of his time. The restoration altered the medieval church to such an extent that its actual form can only be regarded as an example of 19th century architecture.
The entrance of the building leads into the cathedral through the porch of the southern gate. The Virgin Mary gate, - which in the tympanum depicts Virgin Mary falling asleep - is one of the few original medieval remains from the beginning of the 15th century. However, this is already a replica of the 13th century main gate. The rose window above the main entrance is also a reconstructed version of the church's original window. The so-called Matthias Tower standing at the southern side is the most characteristic feature of the cathedral, and can be well spotted from the town, the turret of which is the reconstructed replica of the original one, built under King Matthias, while the traceried steeple spire is Schulek's work. The smaller, so called Béla Tower at the northern side ornamented by colourful glazed tiles, is also Schulek's artwork. Entering the cathedral, the coat-of- arms of King Matthias on the wall by the side of the staircase can be seen, which originally decorated the southern tower, built under the reign of the king, and after which the popular name of the cathedral was given. The Loretto Chapel, of medieval origin, beneath the southern tower preserves a Madonna statue from the end of the 17th century. This work of art was created to replace the original medieval sculpture of the Madonna, which was walled in during the Turkish occupation in the church that was turned into a mosque at the time. According to the legend the statue appeared during an earthquake as if to predict the final triumph of Christianity.
The cathedral is on the site of the foundation of the 13th century church, to which a row of 19th century chapels are attached from the north. The nave, which is covered with four vault sections, is ended by a chancel with a polygonal apse and two chancel aisles with a square termination. The walls are covered by decorative painting by Bertalan Székely and Károly Lotz, who utilised the remains of the medieval wall paintings. The colourful glass windows were also designed by the two artists. The neo-Romanesque and neo-Gothic altars were designed by Frigyes Schulek. The first chapel situated left from the cathedral's main entrance, is the Szent (Saint) Imre Chapel, with an altar painting illustrating the life of the saint painted by Mihály Zichy. The next chapel preserves the mortal remains of King Béla III and his wife Queen Anna of Antioch, which were unearthed during the excavations carried out on the ruins of the royal basilica in Székesfehérvár in 1848. The next chapel is a sacristy, followed by the Szent István (Saint Stephen) chapel and the royal oratory. On the northern side of the sanctuary above the altar, the replica of the head reliquary of King Saint László can be seen, the original of which is preserved in Gyor. The entrance leading down to the crypt and through the crypt to the ecclesiastical exhibition rooms of the cathedral is located in the southern chancel aisle. The cathedral can be left through the side gate, which was built on the basis of the original from the 13th century.
The last Hungarian King, Charles IV. and his wife, Queen Zita were crowned in the crowning cathedral in 1916, following the cathedral's re-consecration in the year of the Millenium (1896). Between 1936 and 1944 major restoration work was carried out on the cathedral under János Schulek's direction, but during the siege of Budapest in 1944-1945 the building was severely damaged. The cathedral's interior was again restored between 1954 and 1964 and the exterior between 1964 and 1970.