In 1861 the British took Lagos as a colony. The same year they bombarded Porto Novo, which became a French protectorate in 1862. The Anglo-French agreement of 1889 and the British declaration of a protectorate in 1891 prepared the ground for conquest.
In 1892 the British invaded Ijebu country and defeated the Ijebu army at Magbon; they had come to open the road between Lagos and Ibadan. In the same year the French conquered Dahomey. Early in 1893 Lagos officials made a treaty with Ibadan, sent its armies home and saw the Kiriji camps disbanded. The 1890s saw the end of the major wars. In the north-east, peoples of the Okun and nearby Yoruba areas formed the Ogidi Alliance in 1894 to resist the Nupe, until the Royal Niger Company took Bida in January 1897.
Yorubaland was divided between three European powers: most of it British Nigeria, a smaller part French Dahomey, and a still smaller part German (later French) Togo. Two international boundaries now cut through kingdoms, communities and families.