Nigeria's government said on Friday it was suspending Twitter's operations in the country indefinitely.
This came two days after the social media company deleted a tweet from President Muhammadu Buhari's account for violating its rules.
Twitter was still working in Africa's most populous country soon after Friday's statement, which triggered criticism from rights groups and analysts about freedom of expression.
Nigeria's Information Ministry said Twitter was "suspended indefinitely" because of "persistent use of the platform for activities that are capable of undermining Nigeria's corporate existence".
When asked about the decision, ministry special assistant Segun Adeyemi said: "I can't answer technicalities ... operations will be suspended indefinitely."
The ministry also announced the suspension on its own Twitter account, though it gave no details on when that would take effect.
"The announcement made by the Nigerian government that they have suspended Twitter's operations in Nigeria is deeply concerning," Twitter said.
"We're investigating and will provide updates when we know more."
The ministry did not give details about what activities were threatening Nigeria.
Twitter on Wednesday deleted a post on Mr Buhari's account for violating regulations when he referred to the 1967-70 Nigerian Civil War in a warning about unrest in the south-east.
The president, a former general, referred to people "misbehaving" in violence in the south-east, where officials blame separatists for attacks on police and election offices.
Mr Buhari, 78, said he was using "the language they will understand".
Minister of Information Lai Mohammed on Wednesday accused Twitter of ignoring violent messages from a separatist leader and also referred to Twitter chief executive Jack Dorsey's support for the #EndSARS protests, that took place against police brutality last year in Nigeria.
Friday's decision criticised by rights groups.
"This repressive action is a clear attempt to censor dissent and stifle the civic space," Human Rights Watch researcher Anietie Ewang said on Twitter.
Amnesty International called for Nigeria to immediately reverse the "unlawful suspension".
"This is the height of muzzling the freedom of expression that can only happen in dictatorships," Bulama Bukarti, an analyst at the Tony Blair Institute for Global Change, said on Twitter.
"It will go down in history as one of Mr Buhari's biggest mistakes and PR disasters."
Nigeria in 2019 had announced it would tighten regulations on social media to fight fake news and disinformation, but the proposal sparked concerns over freedom of expression.
In February, Twitter condemned Myanmar's move to block access to its platform as part of a crackdown on social media days after a coup that resulted in the jailing of Aung San Suu Kyi and other civilian leaders.