<P> In 1186, a letter from Pope Urban III states that the castle of Hafn (Copenhagen) and its surrounding lands, including the town of Hafn, were given to Absalon, Bishop of Roskilde 1158--1191 and Archbishop of Lund 1177--1201, by King Valdemar I. On Absalon's death, the property was to come into the ownership of the Bishopric of Roskilde . Around 1200, the Church of Our Lady was constructed on higher ground to the northeast of the town, which began to develop around it . </P> <P> As the town became more prominent, it was repeatedly attacked by the Hanseatic League . As the fishing industry thrived in Copenhagen, particularly in the trade of herring, the city began expanding to the north of Slotsholmen . In 1254, it received a charter as a city under Bishop Jakob Erlandsen who garnered support from the local fishing merchants against the king by granting them special privileges . In the mid 1330s, the first land assessment of the city was published . </P> <P> With the establishment of the Kalmar Union (1397--1523) between Denmark, Norway and Sweden, by about 1416 Copenhagen had emerged as the capital of Denmark when Eric of Pomerania moved his seat to Copenhagen Castle . The University of Copenhagen was inaugurated on 1 June 1479 by King Christian I, following approval from Pope Sixtus IV . This makes it the oldest university in Denmark and one of the oldest in Europe . Originally controlled by the Catholic Church, the university's role in society was forced to change during the Reformation in Denmark in the late 1530s . </P> <P> In disputes prior to the Reformation of 1536, the city which had been faithful to Christian II, who was Catholic, was successfully besieged in 1523 by the forces of Frederik I, who supported Lutheranism . Copenhagen's defences were reinforced with a series of towers along the city wall . After an extended siege from July 1535 to July 1536, during which the city supported Christian II's alliance with Malmö and Lübeck, it was finally forced to capitulate to Christian III . During the second half of the century, the city prospered from increased trade across the Baltic supported by Dutch shipping . Christoffer Valkendorff, a high - ranking statesman, defended the city's interests and contributed to its development . The Netherlands had also become primarily Protestant, as were northern German states . </P>

When did copenhagen become the capital of denmark