Kronborg Chapel was inaugurated in 1582. A fire at the castle in 1629 left the Chapel mostly untouched, but when the castle was repurposed in the 18th century as a military garrison, the space was used for storage and training. In the 1840s it was returned to its religious purpose. It is occasionally used for royal weddings, and from time to time members of the local paris of St. Marie Church use it for weddings. The bells are still sounded on the first Sunday of each month and for church festivals. Known as Hamlet's Castle because William Shakespeare based his play Hamlet in the castle at Elsinore, Kronborg Castle sits on the narrow channel between Sweden and Denmark that serves as a gateway to the Baltic. The castle was built on a spot where there were older fortifications; the current version dates back to the late-16th century.