The states of Kanem and Borno, which flourished on the shores of Lake Chad from about AD 10 onwards, were the first imperial states in the region, founded on control of trans-Saharan trade routes. In the 15th century, the Portuguese began trading but, by the end of the 19th century, the British had conquered present-day Nigeria. After gradual internal self-government, full independence was achieved in 1960. Since then, the country has endured numerous changes of government. Nigeria's army has chosen to intervene on several occasions to thwart a perceived threat to the integrity of the nation.
The greatest crisis came about in the mid-1960s, when the eastern part of the country - styling itself the 'Republic of Biafra' - attempted to secede. A three-year (1967-70) civil war followed, at the end of which the secessionists were defeated and up to 30,000 people of Ibo origin were dead. General Murtala Mohammed - widely viewed as a military hero - overthrew the government in 1974. Mohammed was assassinated in 1976, replaced by army chief of staff General Olusegun Obasanjo, who would return as civilian president a quarter-century later.
A series of coups and attempted coups followed, until civilian elections were organised in 1993 and won by Moshood Abiola, a former publisher who had been put up as a purely token opposition candidate. The military annulled the elections and returned the country to military rule.
Sani Abacha emerged as the new military strongman and, over the next five years, presided over an increasingly oppressive regime that attracted particular criticism for its treatment of the Ogoni people. Their leader, the renowned writer Ken Saro-Wiwa, was executed along with eight colleagues. Thereafter, the Abacha government suffered increasing diplomatic isolation, including from Nelson Mandela, who was then president of South Africa.
Obasanjo returned to power in elections after Abacha's death in 1998, and faced the task of dealing with growing religious conflict that continues to this day. Several northern states adopted strict sharia law in 2000 and in 2002 more than 200 were killed after Muslim outrage over the planned Miss World beauty pageant in Kaduna.
Obasanjo was succeeded by Umaru Yar'Adua in 2007 and soon after, oil production began to soar. Clashes between Muslims and Christians grew after Yar'Adua's death and Goodluck Jonathan's election as president in 2010, with a spate of deadly Christmas Day attacks killing at least 40 in 2010. Boko Haram militants claimed responsibility for the deaths of thousands in the next few years, and a state of emergency was declared in three northern states in 2013. The attacks continued into 2014, when Nigeria overtook South Africa as Africa's biggest economy.