Czaki, during a meeting of the Committee of the Crown Treasury in Warsaw, proposed a plan of building a canal, which would connect the Vistula via the Brda with the Noteć river. Józef Wybicki, Polish jurist and political activist best known as the author of the lyrics of the national anthem of Poland, worked at the Crown Tribunal in Bydgoszcz. Late modern period In 1772, in the First Partition of Poland, the town was acquired by the Kingdom of Prussia as Bromberg and incorporated into the Netze District in the newly established province of West Prussia. At the time, the town was seriously depressed and semi-derelict. Under Frederick the Great the town revived, notably with the construction of a canal from Bromberg to Nakel (Nakło) which connected the north-flowing Vistula River via the Brda to the west-flowing Noteć, which in turn flowed to the Oder via the Warta. During the Kościuszko Uprising, in 1794 the city was briefly recaptured by Poles, commanded by General Jan Henryk Dąbrowski, and the local Polish administration was co-organized by Józef Wybicki. In 1807, after the defeat of Prussia by Napoleon and the signing of the Treaty of Tilsit, Bydgoszcz became part of the short-lived Polish Duchy of Warsaw, within which it was the seat of the Bydgoszcz Department. With Napoleon's defeat at the Battle of Nations in 1815, the town was re-annexed by Prussia as part of the Grand Duchy of Posen (Poznań), becoming the capital of the Bromberg Region. During the November Uprising, a Polish insurgent organization was active in the city and local Poles helped smuggle volunteers, weapons and ammunition to the Russian Partition of Poland. After the fall of the uprising, one of the main escape routes for surviving insurgents and civilian insurgent authorities from partitioned Poland to the Great Emigration led through the city. In 1871 the Province of Posen, along with the rest of the Kingdom of Prussia, became part of the newly formed German Empire. During German rule, the oldest church of the city (church of Saint Giles), the remains of the castle, and the Carmelite church and monastery were demolished. In the mid-19th century, the city saw the arrival of the Prussian Eastern Railway. The first stretch, from Schneidemühl (Piła), was opened in July 1851. During World War I, Poles in Bydgoszcz formed secret organizations, preparing to regain control of the city in the event of Poland