DAKAR, Senegal — Nigeria has blocked Twitter after the social media site deleted a tweet by President Muhammadu Buhari that threatened secessionist groups in the southeast who had been responsible for attacks on government offices.
The government suspended Twitter, which is used by millions of Nigerians, on Friday night, after a government official called the microblogging platform’s presence in Nigeria “very, very suspect.”
Twitter users in Nigeria expressed outrage at the blocking of one of the main outlets that they have to criticize their government and try to hold it to account. Many circumvented the suspension by using virtual private networks to access the service, raising questions of how effective the ban will be.
Twitter said Saturday that it was “deeply concerned” by Nigeria’s action and would work to restore access “for all those in Nigeria who rely on Twitter to communicate and connect with the world.”
Apparently incensed by defiance of the ban, Nigeria’s attorney general, Abubakar Malami, ordered prompt prosecutions of anyone found flouting it. A spokesman for Mr. Malami, Umar Jibrilu Gwandu, said Saturday in a statement reported by Nigerian news media that prosecutors had been directed to “swing into action” and “ensure the speedy prosecution of offenders without any further delay.”
The statement did not specify how Twitter users would be identified for prosecution. Nor did it specify the punishment.
In the tweet deleted by Twitter on Wednesday, Mr. Buhari drew a connection between Nigeria’s civil war decades ago and attacks on offices of the national electoral commission by arsonists and gunmen.
Most of the attacks have been in the southeast, which declared itself the Republic of Biafra in the 1960s and fought a devastating war for secession. Mr. Buhari, who has 4.1 million followers on Twitter, was a commander on the side of the Nigerian government during the war.
“Many of those misbehaving today are too young to be aware of the destruction and loss of lives that occurred during the Nigerian Civil War,” he wrote in the now-deleted post. Those “who went through the war, will treat them in the language they understand.”
Some saw his words as a threat of genocide against the Igbo ethnic group that is in the majority in Nigeria’s southeast. Twitter said the tweet violated its “abusive behavior” policy.
Mr. Buhari came to office in 2015 in the country’s first peaceful transition of power between two parties, but his previous stint ruling Nigeria was as a young general in the 1980s after he took power in a coup. Since independence in 1960, Nigeria has undergone many decades of repressive military rule.
Nigerian Twitter users have played an outsize role in trying to hold their government to account. The platform was one of the key forms of communication and publicity for protesters in EndSARS, a youth-driven movement that began with calls to abolish an abusive police unit and which led to much wider demands for better governance in West Africa’s biggest democracy.
In a news conference after Mr. Buhari’s tweet was deleted, the information minister, Lai Mohammed, compared Twitter’s actions in Nigeria to those the company took after the riot at the U.S. Capitol in January, including banning the account of former President Donald J. Trump.
“When people were burning police stations and killing policemen in Nigeria during EndSARS, for Twitter it was about the right to protest,” he said. “But when a similar thing happened on the Capitol, it became insurrection.”
The reason for blocking Twitter, Mr. Mohammed said later, was “the persistent use of the platform for activities that are capable of undermining Nigeria’s corporate existence.”
In April, Twitter said that it was opening its first Africa office in Ghana, because the country was “a supporter of free speech, online freedom” and an open internet. Some analysts considered the move a snub for Nigeria, which is home to a thriving tech industry.
Shutdowns of the internet or social media are increasingly used by governments around the world, particularly in election periods. Countries that have censored Twitter include China and Iran.
Twitter worked on some cellphone carriers and not others on Saturday, according to tests conducted by Reuters in Lagos and Abuja.
Facebook and WhatsApp are the social networks used by most Nigerians, but the country’s intellectuals, activists and journalists tend to gravitate toward Twitter — and many were able to keep tweeting after the ban.
“Thank God for VPN” was trending on Twitter in Nigeria on Saturday, and many Nigerians took to the platform to comment that Africa’s biggest democracy was showing worrying signs of dictatorship in suppressing the right to free speech.
“Suspending Twitter in Nigeria is just one more way of stating that people’s rights do not matter,” Osai Ojigho, Amnesty International’s country director in Nigeria, said in a tweet. “This is a dangerous precedent.”
“We must resist every attempt at a dictatorship,” wrote Editi Effiong, a filmmaker who covered EndSARS.
“The last move of a failing Government is always to try to silence everyone who points out that they are failing,” posted Mark Essien, a Nigerian entrepreneur and software developer.
Even some government officials continued tweeting.
“You didn’t get the memo!” one Nigerian Twitter user tweeted at Sharon Ikeazor, minister of state for the environment, after she posted a tweet about an event on plastic pollution on Saturday morning.