Image copyright AFP Image caption James Ricketson has denied all charges

An Australian filmmaker who was sentenced by a Cambodian court to six years in prison on spying charges has been granted a royal pardon.

James Ricketson, 69, was arrested in June 2017 while flying a camera drone over an opposition rally.

Mr Ricketson, who denied the charges, has been a critic of long-standing Cambodian Prime Minister Hun Sen.

His arrest was part of a wider crackdown on dissent by the increasingly authoritarian government.

The court said it had ordered the filmmaker's release after receiving the royal pardon, Reuters news agency reported on Friday.

'Relief and excited'

He was released from prison at 17:00 local time (11:00 GMT) said Be Tea Leng, the deputy director of Phnom Penh's Prey Sar prison where Mr Ricketson had been jailed.

His lawyer, Kong Sam Onn, said his client could be bound for Australia shortly, the Australian Associated Press (AAP) reported.

Prior to his release, Mr Ricketson had been transferred to a prison hospital after his health deteriorated and he lost weight, the agency added.

"We are just so relieved and excited about this news... It has been a really tough 16 months and I'm just kind of in shock right now," said his son Jesse.

The Change.Org page set up by his daughter Roxanne Holmes has been updated to thank the petition's 10,000 supporters.

"It feels like the pain of the last 14 months has hit me in one go, so many emotions but above all, I am so happy," she wrote.

Image copyright AFP Image caption The courts did not name the country he allegedly spied for

Mr Ricketson had visited Cambodia frequently over the last 20 years to make documentaries before he was charged with spying for an unknown country.

During the trial, the prosecution argued that Mr Ricketson's work had damaged Cambodia's reputation on the world stage.

The prosecution's main argument relied on several emails in which he expressed sympathy for opposition groups.

In one email, he urged Australia's government to withdraw an invitation for Hun Sen in 2016.

The New-York based group Human Rights Watch called his trial a "ludicrous charade".

A number of Cambodian activists and opposition lawmakers were freed in the weeks following July's election. Hun Sen's party claimed a landslide victory in a vote with no main opposition.