Update as of 4:18 a.m. EDT: Guatemalan President Otto Perez Molina has resigned, his spokesman said on Thursday, after he was stripped of immunity and a warrant was issued for his arrest over major corruption allegations.

Perez Molina, who has been in power since 2012, said he was stepping down to confront "individually the proceedings against him," his spokesman Jorge Ortega said, according to Agence France-Presse.

Original story:

Guatemala’s attorney general on Wednesday issued an arrest warrant for President Otto Perez Molina amid a massive corruption scandal that has plunged the country into chaos just days before an election. Perez Molina had his immunity stripped by lawmakers the previous day, opening the way for him to be investigated and charged for allegedly leading a major customs corruption ring.

Perez Molina has repeatedly denied calls for his resignation and refuted any links to the customs ring in which public officials reduced import tariffs in exchange for kickbacks. The arrest warrant also comes just days before a Sunday election, in which Perez Molina is constitutionally barred from contesting.

"The arrest warrant for the president has now been issued" by Judge Miguel Angel Galvez, prosecutors’ spokeswoman Julia Barrera said, according to Agence France-Presse, adding that the 64-year-old is facing arrest on suspicion of illicit association, fraud and receiving bribe money.

The massive corruption scandal has netted several prominent government officials in the administration of Perez Molina. Vice President Roxana Baldetti resigned in May and was arrested last month, while the ministers of health and economy, recently resigned in protest.

The scandal has seen thousands of Guatemalans staging massive marches, calling for Perez Molina’s resignation. Numerous Guatemalan universities and businesses shuttered their doors earlier in August in solidarity with the protests that lasted several days.

The case against Perez Molina was brought forward by a United Nations-backed commission of prosecutors that has worked alongside the Guatemalan attorney general’s office for almost a decade.