Guatemala's Otto Perez resigned as president and was jailed on Thursday while a judge weighs charging him in a corruption scandal that gutted his government and plunged the country into a political crisis days before a presidential election.
In an emergency session, Congress approved Perez's resignation after the retired general quit overnight.
Former vice president Alejandro Maldonado was sworn in as president to fill out the remaining months of Perez's term.
Tens of thousands of protesters had flooded the streets of the capital and other cities in recent weeks, calling for Perez to step down over allegations he was involved in a customs racket.
Celebrations over Perez's resignation erupted in a plaza of the capital on Thursday, as the country prepared for presidential and congressional elections on Sunday.
Perez, 64, has repeatedly denied any wrongdoing.
The court hearing is set to continue on Friday.