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. In 1825,
Frederick IV, Duke of Saxe-Gotha-Altenburg, who was the uncle of Ernest's first wife Louise, died without an heir. This resulted in a rearrangement of the
Ernestine duchies. It was only as a member of the Ernestine dynasty (and not as Louise's husband) that Ernest had a claim on the late duke's estates. However, he was at that time in the process of divorcing Louise, and the other branches used this as a leverage to drive a better bargain for themselves by insisting that he should not inherit Gotha. They reached a compromise on 12 November 1826: Ernest received Gotha, but had to cede
Saalfeld to
Saxe-Meiningen. He subsequently became "Ernest I, Duke of Saxe-Coburg and Gotha". Although he had given a constitution to Coburg in 1821, he did not interfere in the system of government in Gotha. At Coburg, Ernest was responsible for various construction projects, including the establishment of the
Hoftheater in its new building. The
Schlossplatz as it appears today is largely due to work under his rule. He is chiefly remembered for the economic, educational and constitutional development of his territories, and for the significant international position attained by the house of Coburg. ==Death and burial==