Centuries of European colonization in Africa, including a transatlantic slave trade that lasted well into the 19th century, came to an end as African countries gained their independence in the second half of the 20th century.