ADDIS ABABA (Reuters) - An Ethiopian journalist was sentenced on Friday to 18 months in prison on charges of subversion, his lawyer said, but is expected to be freed within a week as he has been in jail since his arrest in late 2015.

Critics say Ethiopia, an important Horn of Africa ally of the West sandwiched between volatile Somalia and Sudan, regularly targets journalists for alleged security offences as a way to stifle dissent and clamp down on media freedoms. The Addis Ababa government denies those accusations.

Getachew Shiferaw was arrested in late December 2015 and charged in May last year with involvement in the operations of the outlawed anti-government group Ginbot 7.

That charge was later dismissed by a court but he was convicted on Wednesday of undermining state power by trying to prevent a government official from performing his duties through collaboration with an anti-government group. The charge was punishable by up to 10 years in jail.

“The high court’s ruling means he can walk out as a free man next week because he has already spent 17 months under detention,” his lawyer, Ameha Mekonnen, told Reuters.

Getachew, formerly a freelance writer for several magazines, was also editor-in-chief of the opposition Semayawi Party’s Negere Ethiopia publication at the time of his arrest.

Prosecutors accused him of colluding with a member of Ginbot 7, which the government has designated a “terrorist” organization, alongside two domestic secessionist groups, as well as Islamist groups al Shabaab and al Qaeda in Somalia.

Ginbot 7 was formed by opposition figures who took part in the disputed 2005 election. They subsequently fled into exile and launched a rebellion against Addis Ababa.

Ethiopia’s 547-seat parliament does not have a single opposition politician, and opposition groups accuse the government of constant harassment and intimidation.

On Thursday, an opposition politician was sentenced to six and a half years in prison over a series of anti-government comments on Facebook that the court deemed to have encouraged terrorist acts.