GUATEMALA CITY -- Guatemala's Congress on Thursday unanimously accepted the resignation of President Otto Perez Molina amid a fraud probe that has shaken the country's political establishment just days ahead of national elections. Vice President Alejandro Maldonado, who only recently took office after his predecessor resigned in the same kickback scandal, was sworn in the country's new leader.
The unprecedented political drama played out after a week in which Perez Molina was stripped of his immunity, deserted by key members of his cabinet, and saw his jailed former vice president ordered to stand trial.
As Maldonado took office, Perez Molina was in court Thursday hearing accusations that he was involved in a scheme in which businesspeople paid bribes to avoid import duties through Guatemala's customs agency. He is the first Guatemalan president to resign and it was not immediately clear whether he would be detained.
The retired military general insisted upon his innocence in an interview with The Associated Press during a break in the court proceedings, saying the process had been "very hard, very difficult."
He said he could have derailed the investigation, but didn't.
"I had things I could have done," Perez Molina said. "I could have replaced the prosecutor, I could have dug in."
Guatemalan judge has ordered Perez Molina held in jail overnight.
The judge says the decision aims to "ensure the continuity of the hearing." He will spend the night in custody before a court hearing into corruption allegations against him reconvenes.
Perez Molina was taken from the court in an SUV and escorted by a dozen police vehicles, initially surrounded by a scrum of media cameras. The hearing is scheduled to continue at 8 a.m. local time on Friday.
Two officers flanked Perez Molina, but stood by as the former president was peppered with questions by journalists.
Perez Molina said the trip to jail is unnecessary and reiterated his willingness to face the corruption investigation against head-on.
He says he has always promised to "respect due process" and says he is "not going to flee."
Analysts say the resignation was a key blow to entrenched corruption in the country and a boost for rule of law.
"In the midst of this political crisis there is interesting and good news," said Eric Olson, a Central America expert at the Washington-based Wilson Center. "The attorney general resisted strong pressures and even asked for the president to be incarcerated ... that shows the institutions in Guatemala under the right circumstances can operate and be effective."
Earlier in the day, Perez Molina gave an interview to a local radio station, saying that he doesn't "trust Guatemalan justice" and criticizing the nation's prosecutors and the United Nations commission that have mounted a huge investigation in the fiscal fraud case he was implicated in.
He said the case was built by them to "seek prominence" and "to fill their egos."
The corruption scandal, uncovered by prosecutors and a U.N. commission against impunity, involved a scheme known as "La Linea," or "The Line," in which businesspeople paid bribes to avoid import duties through the customs agency. The ring is believed to have defrauded the state of millions of dollars.
Ex-Vice President Roxana Baldetti's former personal secretary was named as the alleged ringleader and is a fugitive. She resigned May 8 because of the same scandal and is now jailed and facing charges. She also maintains her innocence.
A growing protest movement brought together Guatemalans from all walks of life demanding that Perez Molina step down. Business leaders and even Catholic church officials had called for him to resign in recent weeks as the investigation of the customs fraud ring has grown wider and hit more officials.
Perez Molina was steadfast in his plan to stay until the judge's unprecedented order, only deciding to resign in the middle of the night.
His spokesman told reporters the president submitted his resignation "to maintain the institution of the presidency and resolve on his own the legal proceedings leveled against him."
Perez Molina was elected in 2011 on a platform of cracking down in crime. He is a retired general who participated in the country's 36-year bloody civil war, and later in the march toward peace. His critics say he also took part in the atrocities, but he has never been charged with anything.
His election as president had worried leftist groups and human rights organizations because of the military's past control of the government. But Perez Molina has been a political moderate who has kept the military at arm's length, proposing at one point to legalize drugs to rid his country of the scourge of cartels and trafficking.
Maldonado will likely remain in office until the winner of upcoming elections is inaugurated Jan. 14, 2016. The first round is on Sunday, pitting a wealthy businessman and politician against 13 other candidates, including a comedian with no political experience, a former first lady and the daughter of an ex-dictator accused of genocide. If none of the candidates reaches 50 percent, a runoff will be held Oct. 25.
Protesters filling the streets have also demanded that Sunday's presidential elections be postponed. Perez Molina, who was not on the ballot, has said delaying the vote would be against the law.
The U.N.'s commission against impunity said in a report released in mid-July that the country's elections are rife with illegal money, and corruption is the glue holding the system together. Political parties consistently spend far more money than they report taking in and several regularly exceed spending limits without consequence.