GUATEMALA CITY — A Guatemalan judge ordered former President Otto Pérez Molina on Tuesday to stand trial on charges of bribery, customs fraud and conspiracy, and returned him to detention.

It was the third day in court for Mr. Pérez Molina, 64, a retired general who resigned last week, amid mass protests, just days before Sunday’s election to choose his successor. In court, he betrayed little emotion, tightening his lips when Judge Miguel Ángel Gálvez announced the ruling.

“I am frustrated,” Mr. Pérez Molina said, rising at the end of the hearing to deny any involvement in the crimes. If “this can happen to someone who resigned the presidency, what can happen to an ordinary citizen?” he asked.

Judge Gálvez rejected the defense request for bail and sent Mr. Pérez Molina back to the military barracks where he has been held since Thursday. The judge gave prosecutors until December to prepare an expanded case against Mr. Pérez Molina.