KIEV, Ukraine — When the leader of Ukraine told President Trump in July that the next chief prosecutor would be “100 percent my person,” he was putting a modest, dedicated 42-year-old father of three in the hot seat.

Ruslan Ryaboshapka, a longtime reformer who has just taken over as Ukraine’s prosecutor general, has been handed the task of steering his department through a politically perilous moment.

Trump is demanding a criminal investigation of former vice president Joe Biden and his son Hunter Biden, who was on the board of a Ukrainian gas company. The government here has carefully carved out a position: It says it would need new evidence to open such a probe or a formal request from the United States to cooperate in an American investigation.

Any misstep in the weeks ahead — alienating either Republicans who back Trump or Democrats who want to impeach him — could fracture U.S. support for Ukraine even as it gingerly explores a possible peace deal with Russia over the separatist fighting in the east. Without American backing, Ukrainian President Volodymyr Zelensky would find the Russians driving a much harder bargain.

Ryaboshapka’s office would not make him available for an interview for this article.

But it did make news Wednesday, with reports that it is opening a criminal investigation into former president Petro Poroshenko, who was defeated by Zelensky in an April election and is now a member of parliament. Poroshenko was already facing a tax-evasion probe by the State Investigation Bureau, a separate entity. The new charge against him? That he misused his office while president.

Ryaboshapka is “the father of the anti-corruption strategy in Ukraine,” said former associate Oleksandr Lemenov, founder of a civil society group called State Watch. He is one of Zelensky’s best people, Lemenov said, “transparent, smart, professional.”

But he has taken over a deeply compromised system, one that he and other critics say is riven with corruption and logrolling. Ryaboshapka has fired two deputies and the chief prosecutors in 17 of Ukraine’s regions. But even his admirers worry that he lacks the clout to fend off all those who would try to derail his efforts to remake his office into one dedicated to the rule of law.

“He is an honest person,” said David Sakvarelidze, a former deputy in the prosecutor general’s office who clashed with his boss in the previous government, Viktor Shokin. “But being just a good guy is not usually enough. I don’t know if he has the capabilities to meet the expectations of Ukrainian society.”

Trouble could come from the Ministry of Internal Affairs, led by Arsen Avakov, a onetime governor of the Kharkiv region who has had a long career in Ukrainian politics and has hardly been an advocate of reform. Trouble also could come from some of those around Zelensky, Lemenov said. Ryaboshapka already has made a controversial appointment in Kharkiv, picking a veteran prosecutor whose commitment to reform has been questioned by critics.

The head of the nongovernmental Kharkiv Anticorruption Center, Dmytro Bulakh, said this looks disappointingly like a trade-off.

In the Kiev headquarters, according to reports, Ryaboshapka has been resisting pressure from Zelensky aides to name a deputy he doesn’t want.

Ruslan Radetzky worked alongside Ryaboshapka in 2016 and 2017 at an anticorruption agency that was set up at the behest of the European Union. Their job was to review officials’ financial disclosure forms. Ryaboshapka was “professional and knowledgeable,” Radetzky said, but others who had been appointed to the agency undermined their work.

“The dark side blocked us,” he said, and they quit together in 2017. “There was no point in continuing. Society wanted results, and we couldn’t get results.”

Radetzky said that when Poroshenko took office after the 2014 “Maidan Revolution” — called the Revolution of Dignity here — he launched several anticorruption initiatives. They were designed to placate Ukraine’s new friends in Western Europe. They were also designed to fail, Radetzky said. They focused on new young prosecutors while leaving the old guard in place.

“The previous government made six new institutions to battle corruption,” said Sviatoslav Yurash, a member of parliament from Zelensky’s Servant of the People party. “The problem is, when everybody is battling corruption, nobody is. That’s not the way to go. We need to restructure the whole thing.”

But Ivanna Klympush-Tsintsadze, who was a deputy prime minister for European integration under Poroshenko, said she is concerned about a push by Zelensky’s government to give the prosecutor general broad new powers, removing the “checks and balances” of the current system.

If anything unites Ukrainian politicians, it is not wanting to get caught in the gears of a U.S. election campaign. Ryaboshapka’s independence probably wasn’t helped by Zelensky’s “100 percent” remark, although Lemenov argued that the comment can be taken in a positive light. The president is very popular, has firm control of parliament and ought to be able to choose his own top prosecutor, Lemenov said.

The position of prosecutor general is, in the end, a political one, he said.

Radetzky said he agrees, up to a point. “Now it depends on Ruslan himself, whether he will be 100 percent Zelensky’s person or 100 percent prosecutor general. He needs to act according to the law. That’s my only advice to him.”

Natalie Gryvnyak contributed to this report.