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.<br />In an emergency session, Congress approved Perez's resignation after the retired general quit overnight.<br />Former vice president Alejandro Maldonado was sworn in as president to fill out the remaining months of Perez's term.<br />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.<br />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.<br />Perez, 64, has repeatedly denied any wrongdoing.<br />The court hearing is set to continue on Friday.