Meanwhile, in the affairs of Germany and of Europe the character of Karl August gave him an influence out of all proportion to his position as a sovereign prince. He had early faced the problem presented by the decay of the Holy Roman Empire, and began to work for the unity of Germany. The plans of Emperor Joseph II, which threatened to absorb a great part of Germany into the heterogeneous Habsburg monarchy, threw him into the arms of Prussia, and he was the prime mover in the establishment of the league of princes ("") in 1785, by which, under the leadership of Frederick the Great, Joseph's intrigues were frustrated. He was, however, under no illusion as to the power of Austria, and he refused the offer of the Hungarian crown, made to him in 1787 by Prussia at the instance of the Magyar malcontents, with the dry remark that he had no desire to be another Winter King. In 1788 Karl August took service in the Prussian army as major-general in active command of a regiment. As such he was present, with Goethe, at the Battle of Valmy in 1792, and in 1794 at the Siege of Mainz and the Battle of Pirmasenz (14 September) and Kaiserslautern (28–30 November). After this, dissatisfied with the attitude of the powers, he resigned, but rejoined on the accession of his friend King Frederick William III to the Prussian throne. The disastrous campaign of Jena (1806) followed. On 14 October, the day after the battle, Weimar was sacked, and Karl August, to prevent the confiscation of his territories, was forced to join the Confederation of the Rhine. From this time till after the Moscow campaign of 1812 his contingent fought on the French side in all Napoleon's wars. In 1813, however, he joined the Sixth Coalition, and at the beginning of 1814 took command of a corps of 30,000 men operating in the Netherlands.