Construction, widening and reconstruction of the stronghold went on throughout several centuries, with the architecture changing according to the development of weapons. The stronghold achieved its final dimensions – area of more than 30,000 square metres, thickness of the wall between 1.2 and 1.8 meters (3.9 and 5.9 ft), and maximum height over 10 metres (33 ft) – under the reign of Bishop Johannes IV Kievel (1515–1527).[1][3] The western side of the castle houses a 29-metre (95 ft) watchtower dating from the 13th century, later used as a bell tower. The walls were later raised to 15 metres (49 ft).

The inner trenches and blindages, which were built for cannons and as a shelter from bombing, date back to the Livonian War (1558–1582), but it was during this war that the stronghold was severely damaged. The walls of the small castle and the outer fortification were left partly destroyed.[2]

In the 17th century, the castle was no longer used as a defensive building by the Swedes who now ruled the Swedish Estonian Province. In the course of the Great Northern War in 1710, Estonia fell under Russian rule and the walls were partially demolished at the command of the Peter I of Russia, turning the castle in effect into ruins.

The Cathedral of Haapsalu was a cathedral (i.e. the main church) of the Bishopric of Ösel-Wiek, where the throne, the official chair of the Bishop, was situated and where the Chapter of the Bishopric worked. It is the biggest single-naved church in the Baltic countries, with its 15.5-metre (51 ft)-high domical vaults and an area of 425 m2 (4,575 sq ft).[1][2]

The first written record of the church is the charter of Haapsalu where Bishop Hermann I, the founder of the town wrote: "...we, the ones having established the cathedral in Haapsalu and having provided our canons with the appropriate dwellings and income, determined a certain site to be a town, where everybody who has chosen it as their place of living together with us, could gather and find shelter there; and if needed would be able to defend the church with all the means at their disposal."[1]

Built in 1260, the church belongs to the transition period from Romanesque to Gothic architecture. The first is characterized by the plant ornament of the capital of the pilasters and the second by thee star (asteroid) vaults. The portal was also originally Romanesque – the vimperg on the round arch had a niche with the figure of the patron saint. The inner walls were covered with paintings, the floor consisting of the gravestones of clergymen and distinguished noblemen. A unique round baptismal chapel was built in the second half of the 14th century.[2]

During the Livonian War, Estonia became part of the Lutheran Swedish kingdom. The Catholic Dome Church became a church with a Lutheran congregation and was then called the Castle Church. In 1625, the Swedish King Gustav II Adolf sold the town of Haapsalu, the castle and the nearby land property to Count Jacob De la Gardie, who planned to turn the dilapidated stronghold into a modern castle. Arent Passer, a well-known sculptor and master builder, was invited as a consultant.[4]

On March 23, 1688, the sheet-copper roof of the church was destroyed in a fire, but the church was restored relatively quickly. The storm in 1726 destroyed the roof again. The decreased congregation could not afford the renovation and moved to the town church. In the 19th century, the reconstruction of the ruins into a romantic castle park was started.[2]

In 1886–1889, the church was renovated and rebuilt. The ruined Romanesque-style portal was replaced by the pseudo-Gothic "stepped portal", the extant fragments of the wall paintings were covered over, and the tombstones were taken out of the church. On October 15, 1889 the first service dedicated to Saint Nicholas was held.

The Soviet occupation in 1940 led to the closing of the church. During World War II, services were continued, but in the spring of 1944 hooligans broke into the church and destroyed the altar with the altarpiece, the organ, the chairs and the windows. In 1946, the congregation asked the Soviet government to list the Cathedral as a protected historical monument, but it failed to raise their interest. The church was empty for years; for some time it was used for storing grain, even plans for turning it into a swimming-pool were made.[4]

On Mother's Day of 1992, a Mother’s Altar to commemorate Estonian mothers killed during the Soviet occupation was consecrated. The statue of the Virgin and the Child was made by the sculptor Hille Palm.[1]

On full moon nights in August an image of a maiden, The White Lady, is said to appear on the inner wall of the chapel.

During the reign of Ösel-Wiek Bishop, every canon was supposed to lead a chaste and virtuous life according to the rules of the monastery. Access of women to the Episcopal Castle was forbidden by threat of death. A legend tells that a canon fell in love with an Estonian girl and brought secretly the maiden into the castle. She hid by dressing as a choirboy and remained a secret for a long time, but when the bishop visited Haapsalu again, the young singer caught his attention and he ordered an investigation of the singer's gender.[5]

Upon finding the girl, the bishop summoned his council and it decided that the girl should be immured in the wall of the chapel and the canon was to be put in prison where he was starved to death. The builders left a cavity into the wall and the poor girl with a piece of bread and a mug of water was walled in. For some time her cries for help were heard. Yet her soul could not find the peace and, as a result, she appears on the Baptistery’s window to grieve for her beloved man already for centuries, and also to prove the immortality of love.[1][5][6]

The White Lady Days music festival is held at the time of the August full moon.[7]