Guatemala's top court has thrown out the conviction for genocide and crimes against humanity of former military leader Efrain Rios Montt.
The constitutional court ruled that the trial should restart from the point where it stood on 19 April.
On 10 May, Gen Rios Montt was convicted of ordering the deaths of 1,771 people of the Ixil Maya ethnic group during his time in office in 1982-83.
The 86-year-old was sentenced to 80 years in prison. He denies the charges.
Monday's ruling throws into disarray the historic trial of Gen Rios Montt, the first former head of state to face genocide charges in a court within his own country.
The three-to-two ruling by a panel of constitutional judges annuls everything that has happened in the trial since 19 April, when Gen Rios Montt was briefly left without a defence lawyer.
The defence team had walked out of the court on the previous day in protest at what they called "illegal proceedings".
The court ordered that he be represented by a public defence lawyer, which Gen Rios Montt rejected.
The general instead insisted on being represented by lawyer Francisco Garcia, who had been expelled earlier on in the proceedings for trying to have the judges dismissed "for bias".
Mr Garcia was again expelled on 19 April as he accused the presiding judge of failing to hear his legal challenges.
Monday's ruling said the trial should have been halted at this point while the challenges filed by Mr Garcia were being resolved.
According to the constitutional court ruling, the guilty verdict and the 80-year sentence handed down by Judge Jazmin Barrios on 10 May are therefore now void.
Human rights group Amnesty International said it was a "devastating blow for the victims of the serious human rights violations committed during the conflict".
The constitutional court said that statements delivered in court before 19 April would stand, but that closing arguments would have to be given again.
During the hearings, dozens of victims gave harrowing testimony about atrocities committed by soldiers.
An estimated 200,000 people were killed in Guatemala's 1960-1996 civil war, the vast majority of them indigenous Mayans.
Gen Rios Montt's 17 months in power are believed to have been one of the most violent periods of the war.
The BBC's Will Grant in Guatemala City says Monday's low-key press conference contrasted sharply with the day the verdict was announced, when indigenous campaigners and relatives of victims hugged and cried with relief in the packed courtroom.
But he adds that the decision to annul the sentence does not signal the end of the legal battle, as both sides will now start preparing to return to court to replay the final weeks of the trial.
The general's lawyer said he would now demand his release from the military hospital where he was taken from prison after allegedly fainting.