Charles X died in February 1660. Three months later, the Treaty of Copenhagen ended the war. Charles' son and successor, Charles XI, was only five when his father died, so a regency council—led by the queen mother Hedvig Eleonora—assumed power until he came of age. Sweden had come close to control over trade in the Baltic, but the war revealed the need to prevent the formation of a powerful anti-Swedish alliance that included Denmark. There were some successes in foreign policy, notably the anti-French Triple Alliance of England, Sweden, and the Dutch Republic. By early 1672, Sweden had improved its relations with France enough to form an alliance. The same year, King Louis XIV attacked the Dutch Republic, and in 1674 Sweden was pressured into joining the war by attacking the Republic's northern German allies. France promised to pay Sweden desperately needed war subsidies on condition that it moved in force on Brandenburg. A Swedish army of 22,000 men under Carl Gustaf Wrangel advanced into Brandenburg in December 1674 and suffered a minor tactical defeat at the Battle of Fehrbellin in June 1675. Though not militarily significant, the defeat tarnished the reputation of near-invincibility that Swedish arms had enjoyed since the Thirty Years' War. This emboldened Sweden's enemies, and by September 1675 Denmark, the Dutch Republic and the Holy Roman Empire were at war with Sweden and France.