During the German Campaign of 1813, Frederick changed sides and went over to the Allies, where his status as the brother-in-law of the British Prince Regent (later George IV) and uncle to the Russian Emperor Alexander I helped his standing. After the fall of Napoleon, he attended the Congress of Vienna and was confirmed as King. At Vienna, Frederick and his ministers were very concerned to make sure that Württemberg would be able to retain all the territories it had gained in the past fifteen years. Frederick's harsh treatment of the mediatized princes within his domain made him one of the principal targets of the organization of dispossessed princes, which hoped to gain the support of the Powers in regaining their lost sovereignty. In the end, however, Austria, which was seen as the natural ally of the princes, was more interested in alliance with the medium-sized German states like Württemberg than in asserting its traditional role as protector of the smaller sovereigns of the old Empire; and Frederick was allowed to retain his dubiously acquired lands. Frederick, along with the other German princes, joined the new German Confederation in 1815. He died in Stuttgart in October of the next year.