After 1813, Ernest was a Prussian general and participated in military actions against Napoleon. He fought in the battles of Lützen and Leipzig (1813), and drew in 1814 into the French fortress of Mainz. After the battle of Leipzig, he commanded the "5. Armeekorps".