Lagos, where the British concentrated activities after 1851, had been founded as a colony of Benin in about 1700. The British campaign to eradicate the slave trade and substitute for it trade in other commodities increasingly resulted in British intervention in the internal affairs of Lagos. During the early nineteenth century Lagos politics were complicated by a long dynastic dispute which culminated in the deposition of Oba Akitoye in 1845 by Kosoko, his nephew. Kosoko was a leading slave-trader, and the chances for trade in other commodities in the area were regarded as poor by the British as long as he remained in control. In exile, Akitoye gained the support of the British at Badagry. He promised to stop the slave trade at Lagos if reinstated, and Kosoko was expelled with the help of British force. Kosoko fled with his followers to Epe, but continued to interfere in Lagos affairs. After Akitoye's death, the British administrators installed his son Dosunmu as ruler, but in the interests of trade they eventually came to an understanding with Kosoko, who was allowed back to Lagos.
With the establishment of British consular authority over Lagos, trade with the interior increased rapidly, as did cotton production in Abeokuta and the exports of palm oil from Lagos. However, by 1861 the political situation in the interior had deteriorated and trade was being increasingly interrupted. Britain was determined to halt the traffic in slaves fed by the Yoruba wars, and responded to this frustration by annexing the port of Lagos in 1861 and appointing a governor to allow firmer control over trade, and to protect British interests. Thereafter, Britain gradually extended its control along the coast. Suppression of the slave trade and issues related to slavery remained at the forefront of British dealings with local states and societies for the rest of the nineteenth century and even into the twentieth century.