Nigeria has been home to a number of ancient and indigenous kingdoms and states over the millennia. The modern state originated from British colonial rule beginning in the 19th century, and took its present territorial shape with the merging of the Southern Nigeria Protectorate and Northern Nigeria Protectorate in 1914. The British set up administrative and legal structures while practising indirect rule through traditional chiefdoms. Nigeria became a formally independent federation in 1960. It experienced a civil war from 1967 to 1970. It thereafter alternated between democratically elected civilian governments and military dictatorships until it achieved a stable democracy in 1999, with the 2011 presidential election considered the first to be reasonably free and fair.
The name Nigeria was taken from the Niger River running through the country. This name was coined in the late 19th century by British journalist Flora Shaw, who later married Lord Lugard, a British colonial administrator. The origin of the name Niger, which originally applied only to the middle reaches of the Niger River, is uncertain. The word is likely an alteration of the Tuareg name egerew n-igerewen used by inhabitants along the middle reaches of the river around Timbuktu prior to 19th-century European colonialism.