As a consequence of the Anglo-Danish War, Denmark–Norway formed an alliance with the French Empire in 1807. Since Napoleon was already at war with Sweden—which had resulted in the loss of Swedish Pomerania—and while the Swedes refused to enter the Continental System, Denmark–Norway declared war on 14 March 1808. On the behalf of Napoleon, the Russian Empire had likewise invaded Sweden on 21 February 1808; Sweden had thus been forced into a two-front war from the east and the west, while French and Danish forces threatened with an invasion in the south. In mid-April, the Swedish forces went on the counter-offensive with the goal of capturing Norway, as compensation for a potential loss of the eastern territorium (Finland).