Although Swiss neutrality dates back to the 16th century, it wasn’t until after the final defeat of Napoleon in 1815 that the Congress of Vienna finally confirmed its status, and the Vatican City didn’t become neutral until the Lateran Treaty with Italy in 1929. Therefore, Sweden has been neutral the longest.
Sweden’s own fight against Napoleon began with the Fourth Coalition in 1806–1807 and concluded with the Sixth Coalition, during which the French were defeated by an allied army at the Battle of Großbeeren in August 1813, and again at the Battle of Leipzig in October 1813.
But their final war began with victory at the Battle of Bornhöved in December 1813 against Napoleon’s ally, Denmark. As part of the Treaty of Kiel, Norway was ceded to Sweden but they resisted, so a Swedish invasion followed in July 1814 and Norway soon surrendered. The resulting Convention of Moss marked the beginning of Swedish neutrality.
Although Sweden was forced by Germany to lay mines in the Öresund channel during World War I to disrupt Allied shipping, it has remained neutral ever since. However, it is active in UN peacekeeping duties and has a political alliance with the European Union.