Comedian Jimmy Morales took the lead in early vote counting on Monday in Guatemala’s presidential election, amid a massive political upheaval in the country triggered by the jailing of former president Otto Perez Molina over a corruption scandal.

Perez Molina submitted his resignation just before midnight on Wednesday, a day after prosecutors stripped him of his immunity. He has been implicated in a customs corruption scheme known as La Linea (The Line), and was arrested Thursday evening. The 64-year-old retired army general, however, has denied the charges.

With 58.5 percent of the ballots counted, Morales was ahead with 26.5 percent of the vote. He was followed by former lawmaker Manuel Baldizon of the Lider party with 18 percent and former first lady Sandra Torres with about 17 percent of the vote. None of the candidates seemed likely to secure the necessary majority of 50 percent to win outright. This would eventually trigger a runoff between the two top candidates.

Morales, who became famous for playing a simple man who accidentally becomes the president, has campaigned against corruption as a political outsider. He rose meteorically after barely registering on the polls earlier this year. His slogan was: “Neither corrupt nor a thief.”

"I might not be the most capable person, but what Guatemala needs today is to get back to believing in itself," the 46-year-old actor said after taking the lead on Sunday, according to Bloomberg. "We are going to fight corruption emphatically." 

The corruption scandal has triggered months of protests in Central America's biggest economy as thousands of people took to the streets calling for the resignation of the president. 

Following Perez Molina’s arrest last week, Vice President Alejandro Maldonado took over with an aim to finish a term that is set to end in January. “We hope the vote will bring an era of peace, tranquility and consolidation,” Maldonado said before polls closed on Sunday, Bloomberg reported. “The people are fulfilling their duty. The statesmen must also fulfill their duty.”

Some protesters had called for the election to be postponed until anti-corruption reforms could be implemented, but the country’s electoral tribunal rejected calls for a delay. An anti-election protest on Sunday drew just a few dozen people, although several hundred had shown up for a Saturday demonstration, where they dressed in black and carried cardboard coffins that symbolized a “stillborn” vote.

Electoral tribunal chief Julio Solorzano told Agence France-Presse that turnout was between 68 percent and 70 percent, similar to the last general election in 2011.