Because of the Treaty of Campo Formio in 1797, the Fricktal became a protectorate of the French, making the front line between the French Revolutionary and the Austrian troops in the War of the Second Coalition. On 20 February 1802, Rheinfelden was made the capital city of the new Canton of Fricktal, joining the Helvetic Republic in August, the point at which the city became mostly Swiss. The seat of the cantonal government was here instead of in Laufenburg. With the beginning of the "Reichsdeputationshauptschluss" (the German Mediatisation), Napoleon Bonaparte removed the canton of Fricktal. Since 19 March 1803, Rheinfelden has been the capital of the district of the same name, in the canton of Aargau.