In the past, Ukraine enjoyed the steadfast support of the United States in fighting both corruption and a war against Russian-backed separatists. Now, Ukrainians say Washington’s message has grown muddled, in part because Mr. Trump’s personal lawyer, Rudolph W. Giuliani, and his Ukrainian allies see the Western-backed camp of Ukrainian anticorruption reformers as their enemies.

“Giuliani flying in — rather than fighting corruption, he was supporting and meeting with all of the past corrupt people,” said Valeria Gontareva, the former head of Ukraine’s central bank. “As a result, it’s very hard to say what the message is that we now hear from America.”

Nevertheless, anticorruption activists say they see signs of progress.

Mr. Zelensky’s new prosecutor general is modernizing his corruption-plagued office and firing hundreds of prosecutors. A flurry of laws passed by Mr. Zelensky’s months-old parliamentary majority seeks to overhaul the justice system and criminalize illicit enrichment by public officials. The president has even signed legislation establishing a procedure for his own impeachment.

When it comes to enforcing the law, however, Mr. Zelensky’s tests are just beginning. Ukraine’s mafia, for example, is trying to bribe and threaten members of Mr. Zelensky’s ruling bloc in Parliament to derail legislation to crack down on organized crime, said a senior lawmaker, David Arakhamia.

“They meet them by their house and say, ‘We know where your parents live,’” said Mr. Arakhamia, the floor leader of Mr. Zelensky’s party in Parliament.

And just this week Mr. Zelensky’s handpicked prime minister, Oleksiy Honcharuk, offered his resignation after the leak of what he said was a doctored recording on which he is heard to say the president has a “primitive” understanding of economics. Mr. Honcharuk blamed the leak on forces trying to undermine the anticorruption drive. Mr. Zelensky refused his resignation.