Nigeria will lift its ban on Twitter soon after advancing in negotiations to end its differences with the social media giant, the government said on Wednesday.

The ban in June came days after Twitter deleted a remark from President Muhammadu Buhari's account, provoking an international outcry over freedom of expression.

Nigerian officials defended the suspension saying Twitter was used to promote destabilising activities, especially by separatist agitators in the southeast.

"The ban on Twitter will soon be lifted as we are getting close to reaching full agreement," Information Minister Lai Mohammed told reporters in Abuja.

"We have agreed on some areas, hopefully in the next few days or weeks we will conclude."

US-based Twitter said on Wednesday it recently met with the Nigerian government to discuss the ban and how to resolve the matter.

"Our aim is to chart a path forward to the restoration of Twitter for everyone in Nigeria," it said in a statement.

"We look forward to ongoing discussions with the Nigerian government and seeing the service restored very soon."

The minister said the conditions discussed included Twitter registrating locally and designating a local representative as well as paying taxes under Nigerian law.

"I just want to assure you that we have made tremendous progress," he said. "Really, apart from dotting the I's and crossing the T's, we're actually almost there."

About 40 million people have a Twitter account in Nigeria, or around 20 percent of the population
About 40 million people have a Twitter account in Nigeria, or around 20 percent of the population AFP / Olivier DOULIERY

The UN, EU, US and Britain were among the foreign governments that joined rights groups to condemn the ban as damaging to freedom of expression in Africa's most populous country.

The block shocked Nigeria's hyper-connected youth in a country where 40 million people have a Twitter account or around 20 percent of the population, according to NOI polls, a local research organisation.

Twitter has played a key role for activists in Nigeria, with the hashtags #BringBackOurGirls after Boko Haram kidnapped nearly 300 schoolgirls in 2014, and #EndSARS during anti-police brutality protests last year.

The ban decision came just two days after the platform deleted a tweet from Buhari's own account for violating its rules.

He had referenced Nigeria's civil war five decades ago when one million people died, in the context of a warning to those behind recent unrest in the country's southeast.

At the time, Nigeria complained Twitter had not deleted violent remarks made by Nmandi Kanu, whose outlawed IPOB group agitates for a separate state for the region's ethnic Igbo people.

Kanu has since been arrested overseas and brought back to Nigeria where is facing trial.

Officials also made reference to Twitter CEO Jack Dorsey's support for the #EndSARS anti-police brutality protests.

Rights groups had questioned the legality of the decision as Nigeria's parliament did not pass legislation regarding to the ministry's move against Twitter.

Some Nigerian broadcasters were also concerned the move against Twitter was part of a more general crackdown on the media by Buhari's government.