GUATEMALA CITY — Just hours after tendering his resignation as president of Guatemala, Otto Pérez Molina was sent to jail to await the conclusion of a hearing examining his role in a multimillion-dollar customs fraud case that has shaken the nation and sent reverberations throughout the region.

The decision to jail Mr. Pérez Molina highlighted the seismic change sweeping through Guatemala after the corruption accusations in April, and offered a dramatic validation of a growing street demonstration movement demanding his ouster and prosecution.

For much of Guatemala’s violent history, marked by dictatorship and military repression, such a scene would have been unimaginable: a president forced to resign, then sit in open court to hear charges leveled against him and ultimately spend the night in a prison he once might have overseen as a top general.

All that in the course of a single day.

Until now, Mr. Pérez Molina had given no indication that he would go gently. Over months, street protests grew to include tens of thousands of citizens demanding that he step down over accusations that he played a major role in a multimillion-dollar fraud scheme. But still, the president — who was the military’s negotiator during talks to end the nation’s bloody 36-year civil war — denied wrongdoing and refused to leave office. But just before midnight on Wednesday, Mr. Pérez Molina filed his resignation, saying he would “face justice and resolve my personal situation.”