Guatemala City (CNN) -- When former Guatemalan dictator Efrain Rios Montt was convicted of genocide and sentenced to 80 years in prison this month, it was not expected to be the end of story.
Observers knew that an appeal was coming, but it was a separate action -- a ruling by Guatemala's Constitutional Court -- that provided the latest twist in the case.
The Constitutional Court on Monday overturned Rios Montt's conviction and sentence, and ordered the proceedings to return to the trial phase.
The ruling does not annul the entire trial, but everything that happened after April 19, notably the closing arguments and conviction.
The overturning of the conviction is related to a number of procedural complaints filed by the defense. The defense had argued that Rios Montt's rights had been violated when his attorney was expelled early in the trial, and that the head judge should have recused herself. The Constitutional Court decided that the trial should have been suspended while these appeals were in place, instead of pushing forward a conclusion.
Rios Montt, 86, had been found guilty of the genocide of more than 1,700 indigenous Ixil Mayans during his 1982-83 rule.
The trial marked the first time a head of state was tried for genocide by his country's own judicial system.
Dozens of Ixil Mayans took the stand during the trial to recount atrocities committed by the army. The witnesses told the judges about brutal killings, rapes and the razing of villages. The Constitutional Court's ruling allows their testimony to stand.
The trial's original outcome was seen as a precedent for future charges against military officials accused of atrocities during Guatemala's 36-year civil war. The war did not end until 1996, leaving more than 200,000 people dead and 1 million as refugees.
Rios Montt said during the trial that he never ordered the killings of the Ixil.
"We have reached the conclusion that there is still hope for justice, which is the Constitutional Court," Rios Montt attorney Mario Antonio Rossell said. "This is a historic resolution."
Human rights groups say they will appeal the decision.
"What has happened is that in this country, the laws have been applied arbitrarily," said Mario Polanco, director of a Guatemalan human rights group. "They have served the interests of those in power, and when it is one of the representatives of those in power who is on trial, they will resort to any means, and that is what we are seeing. I think there has been an abuse in the interpretation of the law."
CNN's Mariano Castillo reported and wrote the story in Atlanta. Journalist Miguel Salay reported from Guatemala City.