France came to own the whole island in 1795, when by the Peace of Basel Spain ceded Santo Domingo as a consequence of the French Revolutionary Wars. At the time, Saint–Domingue's slaves, led by Toussaint Louverture, were in revolt against France. In 1801 Toussaint Louverture captured Santo Domingo from the French, thus gaining control of the entire island.
In 1802 an army sent by Napoleon captured Toussaint Louverture and sent him to France as prisoner. However, Toussaint Louverture's successors, and yellow fever, succeeded in expelling the French again from Saint-Domingue. There the rebels declared the independence of Haiti in 1804, while to the east, France continued to rule Spanish Santo Domingo.
In 1808, following Napoleon's invasion of Spain, the criollos of Santo Domingo revolted against French rule and, with the aid of Great Britain (Spain's ally) and Haiti,[28] returned Santo Domingo to Spanish control.