After Denmark ceded Norway to Sweden in 1814, Aalborg lost its important role as the country's centre for Norwegian trade. Its former prosperity also suffered as a result of difficulties with the herring industry as the fish disappeared after the sea breached the Agger Tange (which had linked Thy with the rest of Jutland at the western end of Limfjord) in the 1825 North Sea storm. The after effects of the state bankruptcy in 1813 also contributed to widespread poverty in the city. In the mid-19th-century, Aalborg was overtaken by Aarhus as the largest city in Jutland. Towards the end of the 19th century there was however an upturn. In 1865, the pontoon bridge over Limfjord was completed, and in 1869, the railway reached the city with a railway bridge over the sound to Vendsyssel three years later. The harbour facilities were also improved, making Aalborg Denmark's second port. Aalborg became the country's main producer of tobacco products and spirits, followed in the 1890s by fertilisers and cement. By 1901, the population had increased to almost 31,500.