When President Trump spoke on the telephone with Ukrainian President Volodymyr Zelensky in late July, the Ukrainians had a lot at stake. They were waiting on millions in stalled military aid from the United States, and Zelensky was seeking a high-priority White House meeting with Trump.

Trump told his Ukrainian counterpart that his country could improve its image if it completed corruption cases that have “inhibited the interaction between Ukraine and the USA,” according to a readout of the call released by Kiev.

What neither government said publicly at the time was that Trump went even further — specifically pressing Ukraine’s president to reopen a corruption investigation involving former vice president Joe Biden’s son, according to two people familiar with the call, which is now the subject of an explosive whistleblower complaint.

Days after the two presidents spoke, Trump’s personal lawyer, Rudolph W. Giuliani, met with an aide to the Ukrainian president in Madrid and spelled out two specific cases he believed Ukraine should pursue. One was a probe of a Ukrainian gas tycoon who had Biden’s son Hunter on his board. Another was an allegation that Democrats colluded with Ukraine to release information on former Trump campaign chairman Paul Manafort during the 2016 election.

“Your country owes it to us and to your country to find out what really happened,” Giuliani said he told the Ukrainian president’s aide, Andriy Yermak, during the Madrid meeting. Yermak, according to Giuliani, indicated that the Ukrainians were open to pursuing the investigations. The aide reiterated the Ukrainians’ plea for a meeting with Trump, a summit that would be an important signal to Russia of Washington’s support for Ukraine.

Ukrainian President Volodymyr Zelensky speaks during the first session of the new parliament in Kiev on Aug. 29. (Sergei Supinsky/AFP/Getty Images)

“I talked to him about the whole package,” said Giuliani, who has been lobbying Ukrainian officials to take up the investigations since the spring. Yermak did not respond to a request for comment.

New revelations about the dual channels of pressure on Ukraine — one from the president and one from his personal attorney — are fueling questions about whether Trump used his office to try to force a foreign country to take actions damaging to his political opponents.

Giuliani said he has kept the president informed of his efforts in Ukraine for months. But he declined to say specifically what he has told the president. “My narrow interest is for the benefit of my client,” he said.

The White House declined to comment.

Asked Friday if he had discussed Biden on his call with Zelensky in July, Trump told reporters, “It doesn’t matter what I discussed,” adding: “Someone ought to look into Joe Biden.”

National security experts said Trump’s pressure on Ukraine was highly inappropriate.

“This is requesting assistance from a foreign government to tarnish your political rival and opening the door to outside interference in our politics and elections,” said David Kramer, a former State Department official responsible for Russia and Central Europe during the George W. Bush administration.

Giuliani said Trump did not threaten to withhold U.S. funds from Ukraine if the country did not investigate Biden and Democrats.

“He didn’t do that. President Trump didn’t do that,” Giuliani said this week.

However, the Trump administration has held Zelensky at arm’s length since his election in April.

Trump refused to set a firm date for an Oval Office meeting with the newly minted Ukrainian president at the White House — a sit-down that Ukraine has urgently sought to demonstrate Washington’s backing as it fights a long-simmering war with ­Russian-backed proxies in its east.

U.S. officials and members of the Trump administration wanted the meeting to go ahead, but Trump personally rejected efforts to set it up, according to three people familiar with the discussions.

By the time Trump and Zelensky spoke during the July 25 telephone call, the meeting at the White House still hadn’t been set. Soon after, it was disclosed that the White House had put a hold on $250 million in military aid for Ukraine after Trump ordered a review of the assistance package.

Sen. Ron Johnson (R-Wis.) told Zelensky this month in a Kiev meeting that the aid was being held back because Trump was concerned about corruption and thought the Europeans should provide Ukraine more assistance, according to Sen. Chris Murphy (D-Conn.), who was in attendance, as well as an aide to Johnson.

A former senior administration official who repeatedly discussed the issue with Trump said that the president thought “what we were doing in Ukraine was pointless and just aggravating the Russians.”

“The president’s position basically is, we should recognize the fact that the Russians should be our friends, and who cares about the Ukrainians?” said the official, who spoke on the condition of anonymity to describe private conversations.

Meanwhile, throughout the spring and summer, Giuliani was pressing the Ukrainian government behind the scenes, gathering information about Biden and briefing Trump on his findings, he said in several interviews with The Washington Post.

At one point this year, the former New York mayor had planned a trip to Ukraine, but it was scuttled amid criticism about the propriety of his visit. Instead, he has made his case in phone calls and meetings with Ukrainian officials in New York and Madrid.

Giuliani said he was operating in his personal capacity as Trump’s lawyer, although he said the State Department help put him in touch with Yermak.

The State Department did not respond to a request for comment.

U.S. Embassy officials in Kiev repeatedly expressed concerns about the contacts between Giuliani and Ukrainian officials. They have not been privy to most of the discussions, and at times, have only learned later from the Ukrainians, who said they were unsure if Giuliani was officially speaking for the U.S. government, according to two officials with knowledge of the matter.

Giuliani has pushed Ukrainian officials to renew an investigation into the activities of Hunter Biden, who served on the board of a Ukrainian gas producer while his father handled U.S.-Ukraine policy.

In particular, Giuliani has alleged Biden advocated for the firing of a Ukrainian prosecutor who at one point had overseen an anti-corruption probe of the gas producer’s owner. However, the case had been dormant before the prosecutor’s firing, according to former Ukrainian and U.S. officials, and the U.S. ambassador at the time publicly called for the case against the gas tycoon to proceed.

Yuri Lutsenko, the former Ukrainian prosecutor general who succeeded the fired prosecutor, told Bloomberg News in May that there was no evidence of wrongdoing by Joe or Hunter Biden.

But Giuliani has said there is more to uncover, adding that his goal is to make sure Biden didn’t become president without having to answer for the issues in Ukraine.

“What I’m saying to him: You’re not getting from here to the presidency without answering these questions,” Giuliani said in May of his efforts. “The president’s counsel is entitled to develop evidence.”

Biden has denied any wrongdoing.

“Not one single credible outlet has given any credibility to these assertions,” the former vice president said in Cedar Rapids, Iowa, Friday. “Not one single one.”

Giuliani has also urged Ukraine to investigate whether Democrats colluded with Ukrainian authorities during the 2016 election to put out information damaging to Manafort, who is now serving a 7½-year prison sentence for financial crimes related to lobbying he did for a Russia-aligned politician in Ukraine.

In all, Giuliani said he has had about five conversations this year with Yermak, the aide to Zelensky. He said Yermak was concerned that Trump had not met with the Ukrainians and was “embarrassed” at the lack of a meeting — and wanted to make sure “nothing is wrong.”

At the Madrid meeting this summer, Giuliani said he did not address the topic of U.S. aid. “I was not involved in the aid at all,” he said. “I had no idea the $250 million was on the table.”

Giuliani said he left the meeting with the impression that the Ukrainians would pursue the cases he has pushed them to take up. “He told me he would make sure things were investigated appropriately but they would need some time to appoint a new prosecutor,” Giuliani said.

Yermak told the New York Times last month that the new government in Ukraine was committed to fairly investigating possible crimes but all decisions had to wait until the country had a new top prosecutor.

People close to Zelensky have told American officials that if there is a case to pursue, they will follow it and the law — an attempt by Zelensky and his aides to avoid getting drawn into a partisan political fight in the United States.

“For us, the important thing is to not get involved,” said one Ukrainian official earlier this summer, speaking on the condition of anonymity because of the sensitivity of the issue.

“There is nothing good that can come from this,” he added. “I don’t want us to be used.”

During the Kiev meeting with Zelensky this month, Murphy said there was “a large level of discomfort from the outreach of the president’s political team. The embassy didn’t know what to do with it either.”

“I heard they were confused and vexed about what they should do by these requests,” Murphy said Friday. “This is a brand-new president, and he starts getting requests from the president’s political team to do investigation. My concern was definitely validated by the conversations I had in Kiev.”

When they spoke, Zelensky also stressed the importance of a meeting with Trump, adding that he did not want to be drawn into the 2020 presidential election, Murphy said.

Zelensky did not respond to requests for comment Friday.

The two presidents had been scheduled to meet in Warsaw earlier this month until Trump called off the trip, citing Hurricane Dorian’s projected landfall in the United States.

Vice President Pence went in his place. Asked by reporters on the trip if he brought up Biden with his meeting with Zelensky, Pence said he did not. But he connected the delayed military aid to Ukraine’s actions on corruption.

“As President Trump had me make clear, we have great concerns about issues of corruption,” the vice president said. “The president wants to be assured that those resources are truly making their way to the kind of investments that will contribute to security and stability in Ukraine. And that’s an expectation the American people have and the president has expressed very clearly.”

Days later, on Sept. 12, the U.S. aid package was delivered to Ukraine and announced the following day by Zelensky at a political conference.

Zelensky thanked Trump for releasing the $250 million in aid, noting that another $140 million was included as well, adding, “Now I can say that we have excellent relations with the U.S.A.”

“So I think we are really moving in the right direction and we have the right relationship with our strategic partner — the United States of America,” he added.

Murphy said he and other senators were planning legislation to push through the aid that would have won Republican support, potentially forcing the White House’s hand.

Zelensky and Trump are scheduled to meet on the sidelines of the United Nations General Assembly in New York this month. Still, the White House hasn’t set a date for an Oval Office meeting with Zelensky.

Trump’s interactions with Zelensky are part of the whistleblower complaint by an intelligence official that is at the center of a showdown between the executive branch and Congress. Administration officials have refused to divulge any information about the substance of an Aug. 12 report to the inspector general of the U.S. intelligence community.

Earlier this month, House Democrats launched an investigation into whether Trump sought to pressure Ukraine into investigating Biden in exchange for receiving U.S. foreign aid.

Giuliani said he does not believe House Democrats are acting in “good faith” and said the administration’s resistance to sharing more information is justified.

“Congress doesn’t have a decent purpose in getting it. They’re a bunch of headhunters and have lost any credibility,” Giuliani said, adding: “They’re desperately trying to revive their false story about Russian collusion. It’s not a legal issue, it’s a political issue.”

Stern reported from Kiev. Robert Costa, Tom Hamburger, John Hudson, Karoun Demirjian and Julie Tate in Washington, and Holly Bailey in Cedar Rapids, Iowa, contributed to this report.