Sverre was forced to return or risk losing his one secure foothold. During the summer of 1182, Magnus made an attempt to take Nidaros by siege, but was repulsed with grave losses when the Birkebeins launched a surprise night attack. Castle construction In the winter of 1182/1183 Sverre initiated construction of Sverresborg (one of the earliest Norwegian fortresses) to provide him a more secure and more easily defended base from which reside and operate from. The location selected was easily fortified, hard to approach, and could be defended by a small force. The stone for the fortification was available only 0.6 km away in the quarry which had been used for construction the cathedral at Nidaros. Since the Archbishop of Nidaros, who had aligned with King Magnus, was in exile in England from 1180 to 1183, the stonemasons were also available. Work proceeded quickly, and Sverre, along with a detachment of his men, moved out to the castle during Lent in 1183. The sea Battle of Fimreite in 1184 proved to be final struggle between the Birkebeins and the Heklunger; King Magnus drowned. King Sverre, after a six years of struggle, became the uncontested king of Norway. But the peace was not to last for long. Bagler war In 1188 the town of Nidaros, which had been vacated by King Sverre’s men, was attacked. His opposition stormed into the city and a bloodbath followed. The wooden fortress was torn down and the castle burnt and left in ruins. It is not known precisely when it was restored, but the Sverris saga indicates the castle had been restored by 1197. King Sverre died in Bergen on 8 March 1202. Sverresborg is last mentioned in the time of King Sverre’s paternal grandson, King Haakon Haakonson in 1263, when he allowed the walls of Sverresborg to be broken down. Sverresborg Trøndelag Folk Museum In 1914 the area surrounding the ruins of King Sverre's medieval castle was appropriated for the site of the new open-air museum. Today the castle ruins are adjoining the Sverresborg Trøndelag Folk Museum. The museum had started in 1909, when a group of enthusiasts decided to gather buildings and objects characteristic of the area for purposes of preservation. The area around the fortress ruins was set aside for purposes of building a museum and the collection has grown steadily since then. Sverresborg Trøndelag Folk Museum is one of the largest