In 1763, France ceded the rest of New France to Great Britain and Spain, except the islands of Saint Pierre and Miquelon, at the Treaty of Paris which ended the Seven Years' War, part of which included the French and Indian War in America. Britain retained Canada, Acadia, and the parts of French Louisiana which lay east of the Mississippi River, except for the Île d'Orléans, which was granted to Spain with the territory to the west. In 1800, Spain returned its portion of Louisiana to France under the secret Treaty of San Ildefonso, and Napoleon Bonaparte sold it to the United States in the Louisiana Purchase of 1803, permanently ending French colonial efforts on the American mainland.