Eastern Nigeria was part of the Islamic Bornu empire, with their capital at Ngazargamu. Under the Kanem-Bornu ruler Mai Idris Alawma, in the late 1500s, Ngazargamu was a big walled city, with organized city planning and wide, straight streets, and about 20,000 people. Many people came to study Arabic and Islamic theology, history and science there. The Bornu ruled some of eastern Nigeria and Niger, and most of northern Chad. Idris Alawma had diplomatic relations with Ottoman emirs in Tripoli and Cairo, and exchanged gifts with the Ottoman sultans in Istanbul. By 1600, his army, trained by Islamic mercenaries, was using imported guns.
Western Nigeria was mostly under the control of the Hausa Empire, which was between the Bornu empire to the east and the Kingdom of Mali to the west. The Hausa exported slaves north across the Sahara to the Ottoman Empire. They also exported gold, leather from their cattle, salt, and henna. In exchange, they got cotton cloth, . Towards the south, they traded Indian cotton cloth to the Asante Kingdom in Ghana for kola nuts, which have caffeine in them, like coffee. Sometimes the Hausa fell under the control of the Bornu empire, while at other times they were independent, or under the control of the Songhai in Mali.
In 1808 AD, Fulani people attacked and destroyed Ngazargamu, and the Bornu empire collapsed.