Ethiopia has pardoned more than 13,000 people in the past six months who had been charged with or convicted of treason or terrorism, state-affiliated media said on Tuesday.

The previous government had said around 30,000 people including students, opposition leaders, journalists and bloggers were in detention following widespread protests that broke out in 2015.

After the reformist Abiy Ahmed became prime minister in April and began defusing long-standing tension with neighboring Eritrea, a six-month amnesty was introduced for those held under provisions of an anti-terrorism law that critics say has criminalized dissent.

"A total of 13,200 people have since been handed certificates of pardoning," the Fana Broadcasting Corporation said, quoting a statement from the Attorney General's Office.

Following the recent release of political prisoners, parliament on Thursday legalized two secessionist groups - the Oromo Liberation Front and the Ogaden National Liberation Front - and the exiled opposition movement 'Ginbot 7', all previously considered terrorist groups.

The government is now in discussion with opposition politicians and civil society groups to make amendments to the anti-terrorism law.