Opinion surveys ahead of the election showed 53-year-old President Petro Poroshenko trailing far behind comic actor Volodymyr Zelenskiy, reflecting public dismay with Ukraine's endemic corruption, a moribund economy and a five-year fight against Russia-backed insurgents in the country's east.
Zelenskiy, 41, got twice as many votes as Poroshenko in the first round vote three weeks ago. Like his sitcom character, a teacher thrust into the presidency after a video of him blasting corruption went viral. He focused his campaign on fighting graft, riding the wave of public distrust of Ukraine's political elite.
Poroshenko, a billionaire candy magnate before he took office, has relied on traditional political barnstorming, using sympathetic television stations to extensively cover his appearances.
Zelenskiy largely stayed away from the campaign trail and eschewed interviews. He campaigned mainly on Instagram, where he has 3.7 million followers. After Zelenskiy voted Sunday, police handed him a court summons for failing to keep his ballot away from cameras, an administrative offense punishable by a $30 fine.
The candidates engaged in fierce mutual criticism and jockeyed for dominance. Wrapping up the campaign with a sentimental moment, both men dropped to on their knees during a debate at the country's largest sports stadium Friday to ask forgiveness of those who lost relatives on the eastern battlefront.
Millions of Ukrainians who live in the rebel-controlled east and in Russia-annexed Crimea are unable to vote. Russia seized Crimea in 2014 in a move that Ukraine and almost all of the world views as illegal. Fighting in the east that erupted that same year after the Russian annexation has killed more than 13,000 people.
Poroshenko campaigned on the same promise he made when he was elected in 2014: to lead the nation of 42 million into the European Union and NATO. However, the goals have been elusive amid Ukraine's economic problems, pervasive corruption and fighting in the east. A visa-free deal with the EU spawned the exodus of millions of skilled workers for better living conditions elsewhere in Europe.
In a jab at his rival, the president warned voters that "it could be funny at first, but pain may come later."
Poroshenko emphasized the need to "defend achievements of the past five years," noting the creation of a new Ukrainian Orthodox Church that is independent from Moscow's patriarchate, a schism he championed.
But Poroshenko's message fell flat with many voters struggling to survive on meager wages and pay soaring utility bills.
"We have grown poor under Poroshenko and have to save to buy food and clothing," said 55-year-old sales clerk Irina Fakhova. "We have had enough of them getting mired in corruption and filling their pockets and treating us as fools."
Poroshenko denies any link to an alleged embezzlement scheme involving one of his companies and a top associate.
Zelenskiy, who comes from Ukraine's mostly Russian-speaking east, has opposed Poroshenko's push for a bill that would outlaw the Russian language and mocked the creation of the new church as a campaign stunt.
Speaking to reporters, he said his campaign already "helped unite the country."
Like Poroshenko, Zelenskiy pledged to keep Ukraine on its pro-Western course, but said the country should only join NATO if voters give their approval in a referendum. He said his top priority would be direct talks with Russia to end the fighting in eastern Ukraine.
Zelenskiy's image has been shadowed by his admission that he had commercial interests in Russia through a holding company, and by his business ties to self-exiled billionaire businessman Ihor Kolomoyskyi. A Poroshenko archrival, Kolomoyskyi owns the TV station that aired the sitcom the actor starred in as well as his comedy shows.
However, his ties to Kolomoyskyi have not sullied his image enough to cast him as a corrupt candidate in the eyes of voters.
"I have grown up under the old politicians and only have seen empty promises, lies and corruption," said Lyudmila Potrebko, a 22-year-old computer programmer who cast her ballot for Zelenskiy. "It's time to change that."