Detained Australian filmmaker James Ricketson gestures from a prison van on arrival for his trial at a Phnom Penh court on June 15. Ricketson, was arrested in Cambodia last year and charged with spying after he flew a drone over an opposition rally in the capital. (Photo by Tang Chhin Sothy/AFP)

The Australian filmmaker at the center of a media freedom storm in Cambodia has apologized to Prime Minister Hun Sen for his ignorance about the difficulty of governing the Southeast Asian nation.

In a letter published today by the Khmer Times, James Ricketson, 69, said he now realized that his critical statements carried in the press and other media were "disruptive and ill-informed."

"These statements were made from a place of foreign naivety and ignorance about the complexities and difficulties of governing Cambodia," Ricketson stated.

He was taken into custody in June 2017 and has since been linked by the government to the banned opposition Cambodian National Rescue Party (CNRP).

Investigators have spent more than a year trawling through some 15,000 emails on his computer.

Two local journalists formerly with Radio Free Asia, Yeang Sothearin, 35, and Oun Chhin, 49, are in jail charged with treason.

CNRP politicians have fled the country following a crackdown on dissent and independent journalism ahead of elections due on July 29.

Hun Sen has sought to justify his actions by saying the opposition and "foreign forces" were plotting a "color revolution" to overthrow his government.

The prime minister warned Christians and other religious groups that Cambodia faces civil war if his government loses this month’s poll.

"I apologize unreservedly and without condition for any distress I may have caused as a result of my ignorance of Cambodian issues," Ricketson said in his letter to Hun Sen.

"If there is anything I can do to remedy my mistake, please let me know as I only want the best for you and Cambodia."

Ricketson has said previously that he expected to be charged with espionage under Article 446 of the Cambodian penal code, but in a court appearance last month he told the judge that he had not yet been served with a proper indictment.

His son Jesse confirmed the letter to Hun Sen and added that his father was expected to appear in court next Monday.

Ricketson’s case has spawned worldwide headlines, particularly in his native Australia where more than 76,000 people signed a petition calling for his release.

Prominent people in the movie industry have also backed his cause, including actors Sam Neill, Greta Scacchi, Bryan Brown and Rachel Ward.

Australian journalist Peter Greste, who spent 400 days in an Egyptian prison over allegations he supported terrorism through his coverage for Al Jazeera, also lent support.

And Australian Foreign Minister Julie Bishop has written to the Cambodian government on Ricketson's behalf.

Ricketson also said in his letter to Hun Sen; "I sincerely regret having made any disrespectful comments and I unreservedly apologize in this regard to yourself and your government."

"I can see much more clearly now how much good your government brings to the country and the stability it affords to Cambodians.

"Thank you in advance for your indulgence and understanding of an uninformed foreigner."

Ricketson, who flew a drone over an opposition rally, has denied charges of spying and insists prosecutors had failed to present any evidence to support the allegation.

His health has deteriorated and in early May he was transferred from a squalid, cramped cell to a prison hospital.