KIEV, Ukraine — As soon as he got the invitation from Rudolph W. Giuliani, President Trump’s personal lawyer, it was abundantly clear to him what Mr. Trump’s allies were after.
“I understood very well what would interest them,” Yuriy Lutsenko, Ukraine’s recently fired prosecutor general, said in an extensive interview in London. “I have 23 years in politics. I knew.”
“I’m a political animal,” he added.
When Mr. Lutsenko sat down with Mr. Giuliani in New York in January, he recalled, his expectations were confirmed: The president’s lawyer wanted him to investigate former Vice President Joseph R. Biden Jr. and his son Hunter.
It was the start of what both sides hoped would be a mutually beneficial relationship — but one that is now central to the impeachment inquiry into Mr. Trump.
Mr. Trump and his allies have been fixated on Ukraine since the 2016 American election, convinced that the country holds the key to unlock what they view as a conspiracy to undermine Mr. Trump. Mr. Giuliani in particular has viewed Ukraine as a potentially rich source of information beneficial to Mr. Trump and harmful to his opponents, including Mr. Biden.
But a detailed look at Mr. Lutsenko’s record shows how Mr. Trump and his allies embraced and relied on a Ukrainian prosecutor with no formal legal training and a long history of wielding the law as a weapon in his personal political battles, disregarding the concerns of senior diplomats who said he wasn’t credible.
Mr. Trump praised him in a phone call with Ukraine’s president. Mr. Giuliani aggressively promoted the news that Mr. Lutsenko’s office had revived an investigation into the owner of a Ukrainian energy company that had hired Mr. Biden’s son. And in an interview with Fox News in April, Mr. Trump described Mr. Lutsenko’s claims as “big” and “incredible,” worthy of attention from the American attorney general.
Mr. Trump’s allies even seemed to favor Mr. Lutsenko over the American ambassador in Ukraine, who was recalled as the president’s supporters stepped up pressure on the country to investigate the Bidens. There is no evidence of wrongdoing by Mr. Biden or his son in Ukraine.
In the impeachment debate, Ukraine has often seemed an innocent bystander, a poor and deeply troubled country on Europe’s eastern fringe sideswiped by the raucous political battles of the world’s most powerful nation.
But the scandal now roiling Washington underscores how Ukraine’s own domestic struggles, feuds and dysfunctions have shaped the controversy — and shows how the pursuit of political advantage by actors in each country fed the other in ways that neither side foresaw.
Mr. Lutsenko’s path to Mr. Giuliani began in this political morass, with a meeting so combative that it helped ignite the scandal in the first place.
Shortly after taking up her post in 2016, the American ambassador to Ukraine, Marie L. Yovanovitch, went to meet the new prosecutor general, Mr. Lutsenko, in his office — and complained that his deputies were stained by corruption, according to two Ukrainian officials familiar with the encounter.
The ambassador then pressed Mr. Lutsenko further, the officials said, asking him to stop investigating anti-corruption activists who were supported by the American Embassy and had criticized his work.
Mr. Lutsenko said he snapped at Ms. Yovanovitch that “no one is going to dictate to me” who should be investigated, prompting the ambassador to storm out of the meeting.
“This moment was, how shall we say, not very positive,” recalled Larisa Sagan, Mr. Lutsenko’s assistant at the time. “There were always difficult relations with the U.S. ambassador.”
In the months to come — as the ambassador stepped up her criticism of Ukraine’s faltering efforts to root out corruption — Mr. Lutsenko’s personal animus toward Ms. Yovanovitch grew. He concluded, he and his former colleagues say, that he needed to go around her and find a direct path to a more receptive audience: Mr. Trump’s inner circle.
When Mr. Giuliani learned that Mr. Lutsenko and other disgruntled Ukrainian officials were trying to reach out to the Americans, he welcomed the opportunity.
“Yeah, I probably called, I’m sure I called — Lutsenko didn’t have my number,” Mr. Giuliani said in an interview.
According to notes of their January meetings given to members of Congress last week, Mr. Lutsenko told Mr. Giuliani about what he called payments to Hunter Biden, who sat on the board of the Ukrainian energy company, Burisma.
The two also discussed the theory that Paul Manafort — Mr. Trump’s former campaign manager, who had been convicted in the United States of fraud for his work as a consultant in Ukraine — had been set up by supporters of Hillary Clinton. Ukrainian officials deny such claims, and no evidence supports this idea.
Mr. Lutsenko said he met Mr. Giuliani to seek help recovering billions of dollars he said were stolen from Ukraine under a previous government, a matter unrelated to the American election.
But veterans of Ukraine’s cutthroat politics say Mr. Lutsenko’s outreach to Mr. Trump’s inner circle was a clear attempt to win favor with a powerful ally at a time his own political future looked uncertain.
“Lutsenko was trying to save his political skin by pretending to be Trumpist at the end of his career,” said David Sakvarelidze, a former deputy prosecutor general.
Instead of finding salvation, Mr. Lutsenko was fired in late August by Ukraine’s new president, Volodymyr Zelensky.
Mr. Lutsenko left Ukraine for Britain last Sunday, saying he wanted to improve his English. On Tuesday, Ukrainian authorities announced that they had opened a criminal case against him over accusations that he had abused his power in dealings with politicians and others involved in illegal gambling.
Mr. Lutsenko dismissed the latest case as “a big fantasy.” But to many in Ukraine, it is a fitting coda to the career of an ambitious politician turned prosecutor who used his position to wage political battles.
Even his initial appointment caused controversy: He became prosecutor general in 2016 only after Ukraine’s president at the time, Petro O. Poroshenko, got Parliament to remove a requirement that the prosecutor be educated in the law.
A survivor in Ukraine’s often treacherous politics, Mr. Lutsenko had spent time in jail as a political prisoner, won a seat in Ukraine’s Parliament and served as interior minister, holding senior positions under three presidents.
He also showed himself an adept operator in the United States.
After his meetings with Mr. Giuliani, Mr. Lutsenko provided grist for a series of articles in The Hill, a Washington news portal. His remarks were pitch-perfect in their appeal to Mr. Trump and his supporters.
Mr. Trump tweeted the headline of one of the articles: “As Russia Collusion Fades, Ukrainian Plot to Help Clinton Emerges.”
In another article, Mr. Lutsenko aired his feud with Ms. Yovanovitch, the American ambassador, asserting that she had given him a list of untouchables not to prosecute. The claim set off a storm of accusations that the ambassador belonged to a cabal working to hurt Mr. Trump and protect the Bidens.
The State Department dismissed Mr. Lutsenko’s claim as “an outright fabrication,” and he later acknowledged that the “don’t prosecute list” never existed. In the interview, he blamed the misstep on a bad translation and insisted that Ms. Yovanovitch had, in fact, pressed him not to prosecute anticorruption activists.
But the damage was done. Already under fire from some Republicans, who said she had disparaged Mr. Trump in private meetings, Ms. Yovanovitch was ordered in May to leave her post in Kiev and return to Washington.
When Mr. Lutsenko’s name appeared in a whistle-blower complaint released last week — which accused Mr. Trump of soliciting foreign interference in the 2020 election — the former prosecutor dismissed the account as “filled with multiple lies.”
But in private messages to a Ukrainian anti-corruption campaigner, Mr. Lutsenko gloated about one important part of the complaint: his role in ending Ms. Yovanovitch’s career in Kiev.
In the exchange — with Daria Kaleniuk, the head of Ukraine’s Anticorruption Action Center — Mr. Lutsenko used mafia slang to rejoice at how the American ambassador’s removal had undercut activists campaigning against corruption in Ukraine. Mr. Lutsenko told Ms. Kaleniuk that he had “eliminated your roof.”
“Roof,” a term derived from Russian mafia slang, is used throughout the former Soviet Union to designate a protector or guardian. The “roof” in this instance, Ms. Kaleniuk said, was Ambassador Yovanovitch.
“Lutsenko hated Yovanovitch,” Ms. Kaleniuk said.
To Western diplomats who have followed Ukraine’s turbulent history since it broke free from the Soviet Union in 1991, Mr. Lutsenko was a familiar figure: a seemingly reform-minded politician who, once given power, deeply disappointed his former admirers by displaying many of the ills he had previously denounced.
He had helped organize the street protests that toppled Ukraine’s deeply corrupt, pro-Russian president, Viktor F. Yanukovych, in 2014, meeting with journalists to explain his vision of a Western-oriented country ruled by laws instead of political diktats.
Soon after his appointment as prosecutor general in 2016, however, he began feuding with other law enforcement agencies, notably the National Anti-Corruption Bureau, a body set up in 2014 with strong support from the Obama administration.
The anti-corruption bureau investigated previously untouchable tycoons and politicians, including several of Mr. Lutsenko’s subordinates. These actions — and the praise they received from Ms. Yovanovitch — infuriated Mr. Lutsenko, reinforcing his animosity toward the ambassador and his determination to put the rival agency in its place.
In one particularly high-profile clash, Mr. Lutsenko torpedoed a secret 2017 investigation by the anti-corruption bureau, which had been looking into a passport-for-sale racket run by immigration officials. Mr. Lutsenko posted pictures of undercover agents on the internet, and the case collapsed.
“For this alone he should go to jail,” said Anatoly S. Hrytsenko, a former Ukrainian minister of defense.
Even before he found an ally in Mr. Giuliani, Mr. Lutsenko, his relations with American diplomats in Kiev in tatters, had sought to curry favor directly with the Trump administration.
The effort started in earnest in early 2018, when he tried to shelve criminal cases in Ukraine against Mr. Trump’s former campaign manager, Mr. Manafort, who had made millions of dollars in Kiev as a consultant.
His decision to freeze the Manafort cases came as the Trump administration was completing plans to sell Ukraine a type of sophisticated anti-tank missile called the Javelin. The maneuver hinted at a dynamic now pivotal to the impeachment inquiry — whether the Trump administration, or the president himself, traded security aid for political favors.
Later in 2018, an official in Mr. Lutsenko’s office, Kostiantyn Kulyk — one of the deputies Ms. Yovanovitch had asked Mr. Lutsenko to dismiss at their first meeting — came up with another idea, according to a senior Ukrainian law enforcement official.
Mr. Kulyk had compiled a seven-page dossier on Hunter Biden — a potential way of reaching officials in Washington who had been blocked by Mr. Lutsenko’s testy relations with the American Embassy in Kiev, the official said.
In March, Mr. Kulyk moved to restart the criminal case against the owner of the gas company that had recruited Hunter Biden to sit on its board. But Mr. Kulyk was under a cloud himself: The anti-corruption bureau had investigated him on suspicion of illicit enrichment. Mr. Kulyk did not respond to requests for an interview.
Mr. Lutsenko was confronting a problem of his own. His political patron, President Poroshenko, got trounced in a presidential election in April.
The defeat meant Mr. Lutsenko risked losing his job. While largely discredited in Ukraine as a political operative who had put much of his energy into personal fights, like the one with Ms. Yovanovitch, Mr. Lutsenko still had one significant base of support: Mr. Giuliani and the American president himself.
When Mr. Trump spoke by phone on July 25 with Ukraine’s new president, Mr. Trump complained about the expected departure of Ukraine’s prosecutor, an apparent reference to Mr. Lutsenko.
“I heard you had a prosecutor who was very good and he was shut down and that’s really unfair,” Mr. Trump told Ukraine’s new president, Mr. Zelensky. “A lot of people are talking about that.”
Mr. Lutsenko lost his job anyway, leaving his post a month later.
Mr. Lutsenko “was a very big disappointment,” said Ms. Kaleniuk, the anti-corruption activist. “He decided he couldn’t change the system, or didn’t want to change it.”
His feud with the American ambassador and his outreach to the Trump administration, she added, were all part of a bigger problem — the mixing of politics and justice — that has afflicted Ukraine for years.
In a sign of how perilous this mix can be, even Mr. Giuliani is now shunning the former prosecutor, denouncing him as “corrupted.”
In the interview in London, Mr. Lutsenko said that he told Mr. Giuliani from the start that there was no basis for a case against Mr. Biden or his son.
“Sometimes the mayor is very wise, but sometimes he gets carried away,” he said of Mr. Giuliani.
Asked about this on Friday, Mr. Giuliani had a simple retort: “Liar.”