Until early in 1778, the American Revolution was a civil war within the British Empire, but it became an international war as France (in 1778) and Spain (in 1779) joined the colonies against Britain. The Netherlands, which was engaged in its own war with Britain, provided financial support for the Americans as well as official recognition of their independence. The French navy in particular played a key role in bringing about the British surrender at Yorktown, which effectively ended the war.