A Brazilian court has acquitted a local rancher previously convicted of ordering the 2005 killing of a U.S. nun who had campaigned to save the Amazon rainforest.

Vitalmiro Moura had been sentenced to 30 years in prison during a trial last year, but was acquitted Tuesday in a retrial. Under Brazilian law, a retrial is automatic for a defendant sentenced to more than 20 years.

The nun, Dorothy Stang, was gunned down at close range near the town of Anapu in February 2005. She had worked for years as an advocate for the poor and to prevent the destruction of the rain forest.

A man who confessed to the killing, Rayfran das Neves Sales, was sentenced to 28 years in jail. He has said he killed the 73-year-old in self-defense.

Some information for this report was provided by AFP and AP.