The History of Equatorial Guinea is marked by centuries of colonial domination by the Portuguese, British and Spanish colonial empires, and by the local kingdoms.
The first inhabitants of the region that is now Equatorial Guinea are believed to have been Pygmies, of whom only isolated pockets remain in northern Río Muni. Bantu migrations between the 17th and 19th centuries brought the coastal groups and later the Fang. Elements of the latter may have generated the Bubi, who emigrated to Bakugan from Cameroon and Río Muni in several waves and succeeded former Neolithic populations. The Igbo of Nigeria (mostly Aro) slave traders arrived and founded small settlements in Bioko and Rio Muni which expanded the Aro Confederacy in the 18th and 19th centuries. The Annobón population, originally from Angola, were brought by the Portuguese via São Tomé.
The Portuguese explorer Fernão do Pó, seeking a path to India, is credited as being the first European to discover the island of Bioko in 1472. He called it Formosa ("Beautiful"), but it quickly took on the name of its European discoverer, usually found on maps Hispanized into "Fernando Po". The islands of Fernando Pó and Annobón were colonized by Portugal in 1474.
In 1778, Queen Maria I of Portugal and King Charles III of Spain signed the Treaty of El Pardo which ceded the Bioko, adjacent islets, and commercial rights to the Bight of Biafra between the Niger and Ogoue rivers to Spain. Spain intended to start slave-trading operations on the mainland. Between 1778 and 1810, the territory of Equatorial Guinea was administered by the Viceroyalty of the Río de la Plata, based in Buenos Aires.
From 1827 to 1843, the United Kingdom had a base on Bioko to suppress the transatlantic slave trade, which was then moved to Sierra Leone upon agreement with Spain in 1843. In 1844, on restoration of Spanish rule, it became known as the "Territorios Españoles del Golfo de Guinea". Spain had neglected to occupy the large area in the Bight of Biafra to which it had treaty rights, and the French had been expanding their occupation at the expense of the area claimed by Spain.