The decision comes after President Otto Perez was stripped of his immunity due to corruption charges.

Guatemalan President Otto Perez has resigned, his spokesman said after Congress stripped the leader of immunity over corruption allegations and a warrant was issued for his arrest.

The embattled conservative leader, in power since 2012, took Thursday’s decision to step down to confront “individually the proceedings against him,” his spokesman Jorge Ortega said, days before a national election.

Perez faces prosecution for allegedly masterminding a huge fraud scheme and on Tuesday he was stripped of his immunity due to organised corruption charges against him.

His letter of resignation was signed late on Wednesday and sent to the country’s Congress, which was expected to hold an emergency session early on Thursday to hand power to Vice President Alejandro Maldonado in line with the constitution, the presidential spokesman said.

RELATED: People-power and the ‘Guatemalan Spring’

Prosecutor General Thelma Aldana said Judge Miquel Angel Galvez issued the arrest warrant on Wednesday afternoon on crimes of illicit association, fraud and receiving bribe money related to a widespread customs fraud ring in which the vice president has already been jailed and faces charges.

Under Guatemalan law, Perez would be automatically removed from office if remanded in custody by a criminal court.

Guatemala’s attorney general also said that she was confident the embattled president would be convicted of corruption, as the country’s top court rejected Perez’s challenge to prosecutors’ moves to try him.

‘End of political career’

“This has been happening at an incredibly fast rate. If the judge decides to send him to prison after he is picked up, this might be the end of his political career,” Al Jazeera’s David Mercer, reporting from the Guatemalan city of Antigua, said.

“Despite the mass protests against him, he many times said that he had no connection to this multi-million-dollar fraud.”

The conservative leader is against the ropes after the Guatemalan Congress voted unanimously on Tuesday to strip him of his immunity, clearing the way for prosecutors to go ahead with their case against him.

Investigators accuse Perez of running a scheme in which businesses paid bribes to dodge taxes on their imports, defrauding the country of millions of dollars.

The scandal, which has already felled his former vice president and a string of top officials, comes as Guatemala prepares for elections on Sunday to choose his successor.

Perez is constitutionally barred from running for re-election. His term ends on January 14.

The president has been left increasingly isolated by the scandal.

Six of his 14 ministers have resigned in recent days, along with several other top officials.