WASHINGTON — The U.S. ambassador to the European Union said Thursday that President Donald Trump directed him and other envoys to work with his personal lawyer, Rudy Giuliani, on Ukraine policy and that he disagreed with the directive.

Gordon Sondland's testimony to House impeachment investigators was aimed at distancing himself from Trump and Giuliani's efforts to pressure Ukraine into investigating Democratic rival Joe Biden and his son Hunter.

Sondland said he was disappointed Trump instructed him to work with Giuliani, a directive that sidestepped the role of the State Department and National Security Council. He also said he believes it is wrong to invite a foreign government to conduct investigations for the purpose of influencing American elections.

Sondland is the latest in a series of witnesses to be interviewed behind closed doors by lawmakers. His appearance is especially anticipated since text messages and other witness testimony place him at the center of a foreign policy dialogue with Ukraine that officials feared circumvented normal channels and that is now at the center of the House impeachment inquiry of Trump.

Part of that effort involved pushing Ukraine to commit to politically charged investigations sought by Trump, including into a gas company connected to Hunter Biden.

In prepared remarks obtained by The Associated Press, Sondland aimed to untether himself from any effort by the Republican president or Giuliani to have a political rival investigated, joining other current and former administration officials who have communicated to Congress misgivings about the Trump administration's backchannel dealings with Ukraine.

But Sondland's pivotal role in the dialogue, including discussions about a quid pro quo in which Ukraine's leader would get a coveted White House visit in exchange for satisfying Trump's push for corruption-related investigations, may make those assertions tough for House Democrats to accept.

Sondland said he was disappointed by a May 23 White House meeting with Trump, who spurned calls by the ambassador and others to arrange a phone call and White House visit for the new Ukraine leader, Volodymyr Zelenskiy.

The president was skeptical that Ukraine was serious about reform and anti-corruption and, instead of arranging the meeting his envoys wanted, directed them to talk to Giuliani, Sondland said.

"We were also disappointed by the President's direction that we involve Mr. Giuliani," Sondland said. "Our view was that the men and women of the State Department, not the President's personal lawyer, should take responsibility for all aspects of U.S. foreign policy towards Ukraine."

The envoys, he said, had a choice: They could abandon the goal of a White House meeting with Zelenskiy, something they saw as important in fostering U.S.-Ukraine relations, or they could do as Trump asked and work with Giuliani.

Though he said the ambassadors chose the latter, he insisted that he did not know "until much later" that Giuliani intended to push for a probe of Biden "or to involve Ukrainians, directly or indirectly, in the President's 2020 reelection campaign."

When the phone call finally did occur, on July 25, Trump repeatedly prodded Zelenskiy to investigate the Bidens at the same time that the U.S. was withholding hundreds of millions of dollars in military aid from Ukraine. Sondland said he was not on the call, that he did not receive a transcript until the White House released a rough version last month, and that none of the summaries he reviewed mentioned Biden.

"Let me state clearly: Inviting a foreign government to undertake investigations for the purpose of influencing an upcoming U.S. election would be wrong," Sondland said. "Withholding foreign aid in order to pressure a foreign government to take such steps would be wrong. I did not and would not ever participate in such undertakings."

Sondland, whose name surfaced in a whistleblower complaint in August that helped spur the impeachment inquiry, is certain to be asked about text messages that show him working with two other diplomats to navigate the interests of Trump and Giuliani.

The messages show the diplomats discussing an arrangement in which Ukraine's leader would be offered a White House visit in exchange for a public statement by Ukraine committing to undertake investigations into the 2016 U.S. presidential election and into Burisma, the gas company. He will insist that he did not know until recently that Hunter Biden sat on the board of Burisma, the gas company at issue.

One text exchange that has attracted particular attention involves one diplomat, William "Bill" Taylor, telling Sondland he thought it was "crazy" to withhold military aid from Ukraine "for help with a political campaign." Sondland replied that Trump had been clear about his intentions and that there was no quid pro quo.

Now, Sondland told lawmakers that Trump told him by phone before he sent the text that there was no quid pro quo and that he was simply parroting those reassurances to Taylor.

"I asked the President: 'What do you want from Ukraine?'" Sondland said. "The President responded, 'Nothing. There is no quid pro quo.' The President repeated: 'no quid pro quo' multiple times. This was a very short call. And I recall the President was in a bad mood."

Sondland is testifying three days after Fiona Hill, a former White House aide, said that his actions so unnerved then-national security adviser John Bolton that Bolton said he was not part of "whatever drug deal Sondland and Mulvaney are cooking up," a reference to White House chief of staff Mick Mulvaney.

But Sondland said that neither Hill nor Bolton personally raised concerns about the Ukraine work directly with him.

Lawmakers have been hearing over the last two weeks from other diplomats and administration officials, including from the State Department. The most recent was Michael McKinley, a career service officer and Secretary of State Mike Pompeo’s de facto chief of staff, who testified that the Trump administration’s politicization of foreign policy contributed to his resignation.