France had been an active participant in the European race to build colonial empires around the world. Although it lost its North American possessions at the end of the French and Indian War (also known as the Seven Years War) in 1763, it retained a number of Caribbean islands and French Guiana. Napoleon I briefly regained a section of North America from Spain, but sold it to the United States in the 1803 Louisiana Purchase. Over the course of the 19th century, France extended its control over parts of Southeast Asia, North and West Africa, and islands in the Indian and Pacific Oceans. It also joined Great Britain in dividing the Middle East after World War I, taking responsibility for Syria and Lebanon in a last bid at imperial expansion. However, in the decades following World War II, all European countries came under pressure to dismantle their colonial empires and leave independent states in their place. Under the Fourth Republic, France's overseas empire was reorganized as the French Union, which ostensibly granted more equity and autonomy to the colonies. Nevertheless, Vietnamese forces compelled the French to withdraw from Southeast Asia in 1954, and many other countries gained independence over the next decade.
The most consequential anticolonial struggle for France was that of Algeria, where many French colonists had settled since the first French invasion in 1830. Years of brutal violence and political turmoil—in which the French government contended with both Algerian nationalists and, toward the end, militant colonists and army factions—finally resulted in independence in 1962, but only after a constitutional overhaul in France itself. Meanwhile, a number of former colonies, mainly small island territories, have remained part of France as overseas departements (French administrative regions), and the country retains close relations with most of its former empire in a community not unlike the British Commonwealth.