A court in Mexico has freed a longtime anti-logging activist whose arrest was criticized by human rights groups.

Ildefonso Zamora was detained in late 2015 on burglary charges. The court dismissed the case and he was released late Friday.

Amnesty International said in a statement that Zamora's arrest was "part of a series of threats and harassment in relation to his anti-logging campaign."

Zamora has fought illegal logging in the mountains south of Mexico City for more than a decade.

In a 2007 attack, assailants killed his 21-year-old son Aldo and wounded another son, 16-year-old Misael.

Zamora had received threats before the attack and has said he believes residents associated with the logging were responsible.