In 1800, Spain traded the territory back to France in the Third Treaty of San Ildefonso. After trying to regain control of Saint-Domingue (the present Haiti), where a slave rebellion was underway, Napoleon gave up on his North American colonies, agreeing to sell this territory to the United States in 1803 as part of the Louisiana Purchase.