Count Arvid Horn, leader of the Caps, had governed Sweden since 1719. Following Sweden's defeat in the Great Northern War, he had reversed the traditional policy of Sweden by keeping France at a distance, drawing near to Great Britain, and making no significant effort to regain Sweden's lost Baltic empire. Those opposed to this peaceful policy derisively nicknamed his adherents "Night-caps", and these epithets became party badges when the estates met in 1738. The Hats routed the government, and Horn was compelled to retire after 33 years in high office. Now in power, the Hats aimed at restoring Sweden to her former position as a great power, and sought to renew the traditional alliance with France. France welcomed the rise of a Swedish government which would uphold French interests in northern Europe, and Versailles generously financed the Hat party for the next two generations. The first sign of weakness in the Hats' government came after the war with Russia, which ended in Swedish defeat. In the Riksdag, an inquiry into the conduct of the war was proposed. The Hats managed to avoid this prospect by obtaining precedence for the succession question. King Frederick I had no legitimate children, and it fell to the Riksdag to elect his successor. Negotiations were opened with the Russian empress, Elizabeth of Russia, who agreed to restore the greater part of Finland to Sweden if her heir's uncle, Adolph Frederick of Holstein, were elected successor to the Swedish crown. The Hats eagerly caught at the opportunity of recovering the grand duchy and their own prestige along with it. By the Treaty of Åbo, on 7 May 1743, the terms of the empress were accepted and only a small part which lay beyond the Kymi river, often called Old Finland, was retained by Russia. In the 1750s, the Hats saw the utter collapse of their foreign system. At the instigation of France they entered the Seven Years' War in the Pomeranian theatre, and the result was ruinous. The French had not provided nearly enough money for a long war, and, after several years of unsuccessful fighting, the unhappy Hats made peace, withdrawing from a war which had cost the country 40,000 men. When the Riksdag met in 1760, the indignation against the Hat leaders was so violent that an impeachment seemed inevitable; but once more the superiority of their parliamentary tactics prevailed, and when, after a session of twenty months, the Riksdag was brought to a close by the mutual consent of both the exhausted factions, the Hat government was bolstered up for another four years. But the day of reckoning could not be postponed forever; and when the estates met in 1765 the Hats were comprehensively removed from power. The leader of the Caps, Ture Rudbeck, was elected marshal of the Diet over Frederick Axel von Fersen, the Hat candidate, by a large majority; and, out of the hundred seats in the secret committee, the Hats succeeded in getting only ten. The Hats returned briefly to power in the Riksdag of 1769, but were soon once again defeated by the Caps. Against a backdrop of Russian encroachment, King Gustav III carried out a coup d'etat in 1772 and moved towards an absolute monarchy. During the political upheavals of the ensuing decades, both Hats and Caps disappeared as political forces.