Esztergom was the capital of Hungary from the 10th till the mid-13th century when King Béla IV of Hungary moved the royal seat to Buda. During the same period, the castle of Esztergom was built on the site of ancient Roman castrum. It served not only as the royal residence until the 1241 (the Mongol invasion), but also as the center of the Hungarian state, religion, and Esztergom county.
After changing his residence to Budapest, Béla IV gave the palace and castle to the archbishop. Following these events, the castle was built and decorated by the bishops. The center of the king’s town, which was surrounded by walls, was still under royal authority. A number of different monasteries did return or settle in the religious center.
Meanwhile, the citizenry had been fighting to maintain and reclaim the rights of towns against the expansion of the church within the royal town. In the chaotic years after the fall of the House of Árpád, Esztergom suffered another calamity: in 1304, the forces of Wenceslaus II, the Czech king occupied and raided the castle. In the years to come, the castle was owned by several individuals: Róbert Károly and then Louis the Great patronized the town.
The Ottoman conquest of Mohács in 1526 brought a decline to the previously flourishing Esztergom as well. In the Battle of Mohács, the archbishop of Esztergom died. In the period between 1526 and 1543, when two rival kings reigned in Hungary, Esztergom was besieged six times. At times it was the forces of Ferdinand I or John Zápolya, at other times the Ottomans attacked. Finally, in 1530, Ferdinand I occupied the castle. He put foreign mercenaries in the castle, and sent the chapter and the bishopric to Nagyszombat and Pozsony.
However, in 1543 Sultan Suleiman I attacked the castle and took it. Esztergom became the centre of an Ottoman sanjak controlling several counties, and also a significant castle on the northwest border of the Ottoman Empire. In the 17th century Esztergom was besieged and conquered several times during the Ottoman-Habsburg Wars. Most of the buildings in the castle and the town that had been built in the Middle Ages were destroyed during this period, and there were only uninhabitable, smothered ruins to welcome the liberators.
In 1761 the bishopric regained control over the castle, where they started the preliminary processes of the reconstruction of the new religious center: the middle of the Várhegy (Castle Hill), the remains of Saint Stephen and Saint Adalbert churches were carried away to provide room for the new cathedral.
References:The Clementinum is a historic complex of buildings in Prague. Until recently the complex hosted the National, University and Technical libraries, the City Library also being located nearby on Mariánské Náměstí. The Technical library and the Municipal library have moved to the Prague National Technical Library at Technická 6 since 2009. It is currently in use as the National Library of the Czech Republic.
Its history dates from the existence of a chapel dedicated to Saint Clement in the 11th century. A Dominican monastery was founded in the medieval period, which was transformed in 1556 to a Jesuit college. In 1622 the Jesuits transferred the library of Charles University to the Klementinum, and the college was merged with the University in 1654. The Jesuits remained until 1773, when the Klementinum was established as an observatory, library, and university by the Empress Maria Theresa of Austria.