The Peace of St. Germain ended fighting in the Scanian War between Sweden and Frederick William, elector of Brandenburg. Sweden had been allied with France since 1672, the year that the Dutch War began. Despite this alliance, Sweden had kept out of the war until 1674, but in that year Brandenburg had joined the anti-French alliance, and Sweden had finally been forced to enter the fighting, invading Brandenburg late in the year. During the war Sweden lost all of her German possessions, with Frederick William conquering Pomerania. The Dutch War ended in 1678, and in the aftermath Louis XIV applied considerable pressure on his former enemies on behalf of Sweden. In the Peace of St. Germain Frederick William returned most of Pomerania to Sweden.