A court in the former Soviet republic of Azerbaijan has ordered the release of a journalist who has spent nearly two years in prison on espionage charges.

Rauf Mirkadirov was arrested in April 2014 and sentenced last year to six years in prison for spying for Armenia, Azerbaijan's historic enemy. Mirkadirov has denied the charges.

The appeals court in the capital Baku on Thursday released the journalist after converting his prison term to a conditional sentence.

Mirkadirov has worked as a Turkey correspondent for an independent Azerbaijani newspaper, which was closed down following his arrest.

The Caspian Sea nation has come under criticism for a crackdown on human rights. High-profile journalists like Mirkadirov have been hit with charges which they say is retaliation for their reporting.