The founding of the German Empire was something in the making since the end of the Thirty Years War. After being defeated at the hands of France and Sweden in 1648, Germany became even more fractured. Religion ceased to be as large an issue as before, and not much authority was put into the emperor afterwards. Germany could scarcely even be considered a loose confederation. At the beginning of the 18th century, Saxony, severely weakened after the Great Northern War, was replaced by Prussia as the main power in Germany (excluding Austria). After a few small wars with Austria, Prussia's ceding of Silesia eventually led to the Seven Years War. Commanding the already excellent army, thanks to his father, Frederick the Great managed to defeat his enemies in many battles, but, eventually, the alliance of Austria, Russia, Sweden, France, and other smaller nations began to defeat Prussia. However, increased efforts put forth by Great Britain, and a war weary Sweden's withdrawal (as well as the Russian tsar's replacement by one who admired Frederick), ended the war in an almost stalemate for Prussia. Prussia's next war would be against the Republic of France in 1792, although they were defeated at Viminy. Much of Germany sided with France during the French Revolution and Napoleonic Wars, and Prussia suffered many defeats, the worst being Jena. After the embarrassing defeats, Prussia was kept under French terms until 1812, after the French defeat in Russia.