Napoleon, upon ascending to First Consul of France in 1799, had inherited a republic in chaos; he subsequently created a state with stable finances, a strong bureaucracy, and a well-trained army. In 1805, Austria and Russia formed the Third Coalition and waged war against France. In response, Napoleon defeated the allied Russo-Austrian army at Austerlitz in December 1805, which is considered his greatest victory. At sea, the British severely defeated the joint Franco-Spanish navy in the Battle of Trafalgar on 21 October 1805. This victory secured British control of the seas and prevented the invasion of Britain itself. Concerned about increasing French power, Prussia led the creation of the Fourth Coalition with Russia, Saxony, and Sweden, and the resumption of war in October 1806. Napoleon quickly defeated the Prussians at Jena and the Russians at Friedland, bringing an uneasy peace to the continent. The peace failed, though, as war broke out in 1809, with the badly prepared Fifth Coalition, led by Austria. At first, the Austrians won a stunning victory at Aspern-Essling, but were quickly defeated at Wagram.