In a surprise move, Ethiopia's leader on Wednesday announced plans to drop charges against political prisoners and close a notorious prison camp in what he called an effort to "widen the democratic space for all."

Prime Minster Hailemariam Desalegn's comments came after anti-government protests engulfed much of the restive Oromia and Amhara regions in recent months, bringing many businesses, universities and transport networks to a standstill.

The sometimes deadly protests, the most serious since the current government came to power in 1991, spread into other parts of the East African country, leading to a months-long state of emergency that has since been lifted.

Ethiopians chant slogans against the government during a march in Bishoftu, Ethiopia, on Oct. 2, 2016. (Associated Press)

"Political prisoners that are facing prosecutions and are already under arrest will be released," Hailemariam said. "And the notorious prison cell that was traditionally called Maekelawi will be closed down and turned into a museum."

It was not immediately clear how many political prisoners were being held across the country, a close U.S. security ally.

'Struggling with my tears'

Ethiopians were quick to respond, even with social media sites currently blocked.

"I'm writing you this struggling with my tears," wrote renowned blogger and former detainee Befeqadu Hailu. "All these pledges need to be implemented immediately."

Rights groups and opposition groups in Ethiopia had been calling for the release of political prisoners, saying they were arrested on trumped-up charges and were being punished for their points of view. Ethiopia's government has long been accused of arresting critical journalists and opposition leaders.

Some of the prominent politicians currently in custody include opposition leaders Bekele Gerba and Merara Gudina. A number of journalists also remain in detention.

The months of protests demanding wider freedoms began in late 2015 and led to hundreds of reported deaths and tens of thousands of arrests while disrupting one of Africa's fastest growing economies.

"Today's announcement could signal the end of an era of bloody repression in Ethiopia," Amnesty International researcher Fisseha Tekle said in a statement calling for prisoners' immediate and unconditional release.

While the plans to close the Maekelawi camp are welcome, "the closure must not be used to whitewash the horrifying events that have taken place there," Fisseha said. "For years, Maekelawi has essentially functioned as a torture chamber, used by the Ethiopian authorities to brutally interrogate anybody who dares to dissent, including peaceful protesters, journalists and opposition figures."

Ethiopia, sandwiched between volatile Somalia and Sudan, is often accused by rights groups of regularly using security concerns as an excuse to stifle dissent and media freedoms. It denies the charge.

Its 547-seat parliament does not have a single opposition politician in it, and opposition groups accuse the government of constant harassment and intimidation.

The government in Addis Ababa has denied imposing political restrictions.