In 1778, France, eager to capitalise on the British defeat at Saratoga, recognized the United States of America as an independent nation. Negotiating with Ambassador Benjamin Franklin in Paris, they formed a military alliance. France in 1779 persuaded its ally Spain to declare war on Britain. France despatched troops to fight alongside the Americans, and besieged Gibraltar with Spain. Plans were drawn up, but never put into action, to launch an invasion of England. The threat forced Britain to keep many troops in Britain that were needed in America. The British were further required to withdraw forces from the American mainland to protect their more valuable possessions in the West Indies. While the French were initially unable to break the string of British victories, the combined actions of American and French forces, and a key victory by a French fleet over a British rescue fleet, forced the British into a decisive surrender at Yorktown, Virginia, in 1781. For a brief period after 1781 Britain's naval superiority was threatened subdued by an alliance between France and Spain. However, the British recovered, defeated the main French fleet in April 1782, and kept control of Gibraltar. In 1783 the Treaty of Paris gave the new nation control over most of the region east of the Mississippi River; Spain gained Florida from Britain and retained control of the vast Louisiana Territory; France received little except a huge debt.