Former prosecutor Virginia Laparra (pictured in December 2022) was arrested in February 2022 as part of apparent payback for her anti-corruption efforts AFP

Guatemala's supreme court on Tuesday ordered the release of former anti-corruption prosecutor Virginia Laparra, who was sentenced in December 2022 to four years in prison for abuse of authority in a trial criticized by the international community.

The criminal chamber of the court ordered that "the preventive detention of the accused cease," in a decision reported by the press and confirmed to AFP by Laparra's lawyers.

The decision took into consideration that Laparra had already served almost half of her jail term as she was imprisoned for 10 months before her sentencing on December 16 last year.

The chamber ordered that the court abide by the ruling within five days.

Laparra, 43, was the chief of the Quetzaltenango region of the Special Prosecutor's Office Against Impunity (FECI) when she was arrested in February 2022 as part of apparent payback for her anti-corruption efforts.

She was convicted for "abuse of authority" and given a commutable term of four years.

Under Guatemalan law, she could pay a fine and see her term reduced -- but only once the sentence became final.

Her conviction was criticized by the United States, the European Union, Amnesty International and other human rights organizations.

Laparra is facing a second trial in Quetzaltenango for alleged disclosure of confidential information but there is no start date because the prosecution is trying to replace the judge in charge of the case, who granted her house arrest in July.

Despite that order, the former prosecutor remained in prison inside a military barracks in the capital.

Laparra was one of multiple former prosecutors arrested who had investigated corruption cases.

The crusade against them was led by attorney general Consuelo Porras, who was sanctioned in 2021 by the United States, which included her on a list of "corrupt" and "undemocratic" actors in Central America.

The Guatemalan attorney general's office is accused by Washington of "undermining" democracy due to an investigation of alleged illegalities in the August election won by opposition candidate Bernardo Arevalo, 65, and judicial actions against the president-elect.

Porras's actions are seen as an attempt to prevent Arevalo, who pulled off an upset win on an anti-corruption platform, from assuming power on January 14.

Guatemala is ranked 30th out of 180 countries by Transparency International, which lists nations from most to least corrupt.