His shows were broadcast on the television channel of Ihor V. Kolomoisky, the oligarch he lightly ribbed in a joke about a wealthy man seeking a lost bank called Privat, which sounds like privates. (“Why did the oligarch walk into the strip bar?”)

Mr. Kolomoisky is embroiled in a sprawling banking bailout scandal involving PrivatBank that cost Ukraine $5.6 billion — a staggering expense for a country whose government is propped up by loans from the International Monetary Fund.

Through the television studio, Mr. Zelensky has also been a business partner with the oligarch. Maintaining political clout in Ukraine could help Mr. Kolomoisky, who has moved to Israel, resolve the dispute in his favor. Mr. Zelensky is now positioned at least as the kingmaker in the two-stage election, and even the possible victor.

He has denied that he is a puppet for the scandal-hit mogul and has defended his qualifications as a comedian to lead a country involved both in a shooting war and the broader conflict between the West and Russia.

The contest pitting a comedian telling scatological jokes against two decades-long insiders falls short of the stirring vision of a fresh start that many Ukrainians shared in February 2014, when tens of thousands of protesters swept a corrupt, Russian-aligned government from power.

Yet the mere fact that the country is staging a contested election is something of a victory in the former Soviet Union. Elections in neighboring Russia, in contrast, have become little more than listless endorsements of the ruling party.