In 1707, the Scottish navy was merged into the Royal Navy. Throughout the 18th and 19th centuries, the Royal Navy was the largest maritime force in the world, maintaining superiority in financing, tactics, training, organisation, social cohesion, hygiene, logistical support and warship design. The peace settlement following the War of the Spanish Succession (1702–1714) granted Britain Gibraltar and Menorca, providing the Navy with Mediterranean bases. A new French attempt to invade Britain was thwarted by the defeat of their escort fleet in the extraordinary Battle of Quiberon Bay in 1759, fought in dangerous conditions. In 1762 the resumption of hostilities with Spain led to the British capture of Manila and of Havana, along with a Spanish fleet sheltering there. British naval supremacy could however be challenged still in this period by coalitions of other nations, as seen in the American War of Independence. The United States was allied to France, and the Netherlands and Spain was also at war with Britain. In the Battle of the Chesapeake, the British fleet failed to lift the French blockade, resulting in the surrender of an entire British army at Yorktown. The French Revolutionary Wars (1793–1801) and Napoleonic Wars (1803–1814 &amp; 1815) saw the Royal Navy reach a peak of efficiency, dominating the navies of all Britain's adversaries, which spent most of the war blockaded in port. Under Admiral Nelson, the navy defeated the combined Franco-Spanish fleet at Trafalgar (1805).