from its main trading area, and was besieged in several wars with Brandenburg which shattered the city's economy, which fell in prolonged economic decline. In 1654 the last Pomeranian duke Boguslaw XIV was buried in the Ducal Castle. Major Prussian and German port (1720–1918) In 1713, Stettin was occupied by the Kingdom of Prussia; the Prussian Army entered the city as neutrals to watch the ceasefire and refused to leave. In 1720 the city was officially awarded by Sweden to Prussia. In the following years Stettin became the capital of the Prussian Province of Pomerania, and the main port of the Prussian state. From 1740 onwards, the Oder waterway to the Baltic Sea and the new Pomeranian port of Swinemünde (Świnoujście) were constructed. In 1721, a French commune was founded in the city for the Huguenots. The French were subject to separate French law and had a separate French court, which existed until 1809. In the following years, large groups of Huguenots settled in the city, bringing new developments into the city crafts and factories. The French greatly contributed to the city's economic revival, and were treated with reluctance by the German burghers and city authorities. The population increased from 6000 in 1720 to 21,000 in 1816, and 58,000 in 1861. During the Napoleonic Wars, in 1806 the city surrendered to France without resistance, and in 1809 also Polish troops were stationed in the city. In 1813 the city was besieged by combined Prussian-Russian-Swedish forces, and the French retreated in December 1813. Afterwards it fell back to Prussia. The 19th century was an age of large territorial expansion for the city, especially after 1873, when the old fortress was abolished. In 1821, the crafts corporations were abolished, and in steam transport on the Oder began, allowing further development of trade. The port was developing quickly, specialising in exports of agricultural products and coal from the Province of Silesia. Economic development and rapid population growth brought many ethnic Poles from Pomerania and Greater Poland looking for new career opportunities in the Stettin industry. More than 95% of the population consisted of Germans. In 1843, Stettin was connected by the first railway line to the Prussian capital Berlin, and in 1848 by the second railway to Posen (Poznań). New branches of industry were developed, including shipbuilding (at the AG Vulcan Stettin and Oderwerke shipyards) and ironworks using Swedish ores. Before World War