The town dates back to 1279, when it was chartered and became the centre of the Bishopric of Ösel-Wiek, which it remained for the next 300 years. Buildings from those early days remain today, including an episcopal castle which has the largest single-nave cathedral in the Baltic states, Haapsalu Castle.