Guatemalan ex-President Otto Perez was detained overnight after hearing on corruption charges against him in court.
Perez, who resigned from office on Thursday, was replaced by Vice President Alejandro Maldonado who would complete the last months of the presidential mandate until January.
Hearing on the corruption charges continues on Friday – days before the country’s 7.5 million voters elect a new president and vice president on Sunday.
Perez stands charged with criminal association, corruption and fraud in connection with a ring that helped importers avoid millions of dollars in customs fees in exchange for bribes.
Guatemalan prosecutors and a UN commission believe Perez led the group, which they think was active "at least from May 2014 until April 2015."
"I am innocent, and we hope to defend ourselves from the accusations, so justice may prevail.
"I decided to undergo due process. My decision was to go to the courts, so here we are", Perez said as he arrived in court.
Guatemalans gathered on Thursday on the central Plaza de la Constitucion, in Guatemala City, to celebrate Perez's resignation.
Rigoberta Menchu, an activist for the Rights of Indigenous Communities, who was awarded the Nobel Prize for Peace in 1992, celebrated the resignation as a triumph for Guatemalan society.
Guatemalans gathered at the central Plaza de la Constitucion in Guatemala City to celebrate Perez's resignation.