ADDIS ABABA (Reuters) - Ethiopia has passed a law that grants amnesty to political prisoners who have been released recently and reverses decades of security-obsessed rule.

FILE PHOTO: Ethiopia's newly elected Prime Minister Abiy Ahmed addresses the members of parliament inside the House of Peoples' Representatives in Addis Ababa, Ethiopia April 19, 2018. REUTERS/Tiksa Negeri/File Photo

The law is in line with a breathtaking series of political and economic reforms in Ethiopia, a country of 100 million people, since Prime Minister Abiy Ahmed came to power in April. Among the reforms is a rapprochement with Eritrea.

The government of Abiy’s predecessor, Hailemariam Desalegn, detained around 30,000 people, often under harsh anti-terrorism laws, in response to three years of protests. Detainees included students, opposition leaders, journalists and bloggers.

Security forces also killed hundreds to quell protests against economic mismanagement, inequality and repression.

“The law grants amnesty for individuals and groups either under investigation or convicted on treason, crimes against the constitutional order and armed struggle,” state-affiliated news agency Fana reported.

Abiy has decried state abuses and compared brutality by security forces to state terrorism. Local journalists say tens of thousands of detainees have been released since April. The information minister did not immediately respond to a request for comment.

Several detainees say they were tortured and held underground in solitary confinement for months.

Abiy this month sacked the head of the prison service and other senior prison officials hours before a Human Rights Watch report detailed torture at one notorious prison and urged the government to hold officials to account.

Parliament also ruled that the Oromo Liberation Front and the Ogaden National Liberation Front, two secessionist groups, and the ‘Ginbot 7’, an exiled opposition movement, were no longer terrorist groups.

Abiy visited Cairo in June and secured the release of imprisoned Ethiopians there. In May in Saudi Arabia, he secured the release of around 1,000 jailed Ethiopians.

Some in the ruling coalition oppose Abiy’s reforms because they could lose from a planned sell off of state enterprises, analysts say. Abiy could also face a stiff test at elections in 2020 from opposition parties empowered by the reforms.

New York-based Human Rights Watch said this week Abiy is yet to commit to investigating torture of detainees, the killing of protestors by security forces and other serious abuses.

The group called on the government to repeal the anti-terrorism law, to protect free speech and remove the possibility that Ethiopians can be charged for expressing dissident views.

(This version of the story has been refiled to clarify rapprochement is with Eritrea)