In 1788, Swedish troops in Russian uniforms attacked a Swedish outpost near the Finnish border (Finland was occupied by Sweden by then), causing an outrage in Stockholm. This provided the King with an excuse for the declaration of war on Russia. Denmark, which was under allegiance with Russia, also declared war on Sweden.
On May 22, 1790, the Swedish fleet of around four hundred ships found itself trapped in the Viipuri Bay, as the exit was blocked by one hundred and fifty Russian vessels. On July 3rd the Swedes forced their way out in the so-called Battle of Viborg Bay in which both sides combined lost fifty ships. On July 9 and 10, the Swedish navy won the Second Battle of Svensksund in the Baltic Sea, in which the Russians lost 9500 out of 14000 men and had one third of their fleet captured. It was the greatest naval victory ever gained by the Swedes. The Russians immediately entered on negotiations, and the war was over as peace was signed at Värälä on August 14.
The Russo-Swedish War of 1788-1790 thus was mostly insignificant for every party involved. Russia regarded the Swedish war as a minor distraction, as they were more concerned about events in Poland and in France. Denmark signed with Sweden a status quo-based peace treaty.