PHNOM PENH, Cambodia — An Australian filmmaker who has been outspoken about human rights abuses in Cambodia, and who was arrested while filming an opposition political rally, was sentenced on Friday to six years in prison for espionage.

The filmmaker, James Ricketson, 69, has been in jail since June of last year, when he was detained while flying a drone with an attached camera over the rally. During Mr. Ricketson’s two-week trial, which ended Thursday, prosecutors never said for what country he was supposed to have spied.

But as evidence against him, prosecutors introduced emails Mr. Ricketson had sent to Cambodian opposition figures, along with a draft version of a letter he sent to Australia’s leader outlining abuses by the Cambodian government. Mr. Ricketson had been working on a documentary about the opposition.

His arrest came as Cambodia’s prime minister, Hun Sen, was overseeing a large-scale crackdown on dissent and the press, under which the opposition party was outlawed and dissolved, its leader was imprisoned on treason charges and a number of journalists, rights workers and opposition politicians were arrested or fled the country.