Buhari's government enjoyed widespread public support for its condemnation of economic mismanagement, of government corruption, and of the rigged 1983 elections. This support waned, however, as the government adopted a rigid program of economic austerity and instituted repressive policies that included a sweeping campaign against indiscipline popularly known as "War against Indiscipline". Despite authoritarian tendencies, the campaign is still lauded by many to have instilled the most orderly conduct of public and private affairs in Nigeria since its independence in 1960. Buhari's administration was initially popular with the majority of Nigerians but prohibition against discussing the country's political future, and the detention of journalists and others critical of the government made his support to dwindle.

Buhari was overthrown in a bloodless coup led by General Ibrahim Babangida on August 27, 1985 and other members of the ruling Supreme Military Council (SMC) ostensibly, when he insisted on investigating allegations of fraudulent award of contracts in the Ministry of Defense. If that investigation had been carried through, it is believed that many senior military officers would have been implicated. A Palace Coup was planned and carried out by General Ibrahim Babangida and some senior military officers.

General Babangida rescinded several of Buhari's most unpopular decrees, initiated a public debate on the state of the economy, and eased controls over business. These actions set the stage for negotiations with the International Monetary Fund (IMF) for aid, a new round of austerity measures, and better relations with the country's creditors. For a time, Nigeria achieved a measure of economic recovery.

Babangida maintained a firm grip on power, shuffling key officers from position to position to ensure they would not become too strong. He also forbade political parties. In 1986 and 1990 Babangida faced and suppressed coup attempts. Religious tensions escalated, particularly between Christians and Muslims in several states northern states. Kaduna, Katsina, and Kano, had severe religious riots in the early 1990s.

In early 1989, in preparation for a transfer to democracy, Babangida approved a new constitution that introduced only minor changes to the 1979 constitution. In May he lifted the ban on political organizations but refused to recognize any of the new parties, instead channeling politics into his government-created Social Democratic Party (SDP) and National Republic Convention (NRC). Federal legislative elections were finally held in July 1992, with the SDP winning a majority in both houses of the legislature. The presidential elections were delayed, but finally held in June 1993. Rather than allow the announcement of the results to proceed, Babangida decided to annul the elections without any justification. Initial election results indicated that SDP candidate and wealthy businessman Moshood Abiola had won by a large majority.

Widespread acts of civil disobedience began to occur, particularly in the Southwest region from which Abiola hailed, but these were soon quashed by the security forces and the army. Babangida then announced that the interim government would be inaugurated on August 27, 1993. On August 26, amidst a new round of strikes and protests that had brought all economic activity in the country to a halt, Babangida declared that he was stepping aside from the presidency, and handing over the reins of government to Ernest Shonekan.

The new government lasted only three months before General Sani Abacha, the powerful secretary of defense, overthrew it and assumed control. Among Abacha's first acts was the termination of all political activity. The Nigerian Labour Congress, which had already held a general strike to protest the annulled election of Abiola, organized another general strike to protest Abacha's coup. Political pressure groups such as the Campaign for Democracy also stepped up protests against Abacha. In May 1994 the government announced plans for political reform and held elections for local governments and delegates to yet another constitutional conference.

In October 1995 Abacha lifted the ban on political activity, promised a transfer to civilian power in 1998, and later allowed five parties to operate. However, he continued his repression of dissidents, the most notorious instance of which was the hanging of writer Ken Saro-Wiwa and eight other activists in November 1995. Saro-Wiwa and his fellow dissidents were critics of the oil industry, which had brought a range of environmental ills to their Ogoni homeland in the Niger Delta. The government dubiously accused the activists of murdering government supporters, gave them a hasty, unfair trial, and executed them. The Abacha government imprisoned many people, among the most prominent being former military head of state Olusegun Obasanjo, former vice president Shehu Musa Yar'Adua (who died in prison in December 1997), and the 1993 president-elect, Moshood Abiola. Other prominent Nigerians, including Nobel laureate Wole Soyinka, fled into exile. The execution and imprisonment of opponents and other violations of human rights intensified international pressure on Abacha and resulted in Nigeria's suspension from the British Commonwealth of Nations.

In 1995 a constitutional commission presented a draft constitution. Abacha promised to implement the constitution and return the country to civilian rule following presidential elections in October 1998. He was widely expected to be declared the winner of the elections, as all five officially sanctioned political parties had nominated him as front runner by April 1998. However, in June 1998 Abacha died suddenly of a heart attack.

Major General Abdulsalam Abubakar succeeded Abacha as president and pledged to return Nigeria to civilian rule after holding free, democratic elections. Moshood Abiola, imprisoned since apparently winning the 1993 presidential election, was widely believed to be the frontrunner for the presidency. However, just before he was to be released from prison, Abiola also died suddenly. Abubakar promoted the establishment of political parties and freed political prisoners arrested by Abacha, including former president Olusegun Obasanjo. Nigeria held legislative and presidential elections in February and March 1999. Obasanjo was elected president. The military administration handed over power to Nigeria's new civilian government in May, and the country adopted a new constitution. The Commonwealth of Nations lifted its suspension of Nigeria's membership to coincide with the resumption of civilian rule.