WASHINGTON — Gordon Sondland, the most significant witness yet in the House impeachment inquiry, insisted Wednesday that he and other senior administration officials had “followed the president’s orders” in pushing Ukraine to investigate President Trump’s political foes, offering a firsthand account that shattered several key White House denials.

Sondland, a political appointee who serves as U.S. ambassador to the European Union, did not seek to defend Trump’s months-long pressure campaign, saying he was “adamantly opposed” to the White House suspension of nearly $400 million in military aid intended to help Ukraine fight Russian aggression.

And while Trump and his allies have staunchly denied that the president and his private attorney Rudolph W. Giuliani sought a “quid pro quo” to get Ukraine to investigate Democrats in exchange for a White House meeting, Sondland said he believed it was exactly that.

“Was there a quid pro quo?” he asked near the start of the seven-hour hearing. “The answer is yes.”

His eyewitness account provided House Democrats with the strongest evidence yet in their inquiry into Trump’s efforts to get Ukraine’s president, Volo-dymyr Zelensky, to announce an investigation into a debunked conspiracy theory involving the 2016 U.S. election and former Vice President Joe Biden.

Sondland told the House Intelligence Committee that Giuliani, at Trump’s behest, had pressed Ukraine to launch an investigation in exchange for a White House meeting with Zelensky, and said he “presumed” that the blocked military aid was part of the scheme.

During questioning, he eviscerated Republican arguments that Trump had a legitimate interest in battling corruption in Ukraine. He said Trump didn’t care if Ukraine’s president actually conducted an investigation of Biden — simply that he publicly endorsed one.

Zelensky “had to announce the investigations; he didn’t actually have to do them, as I understood it,” Sondland said.

Sondland’s often damning testimony appeared to catch the White House and its defenders off guard. As the impact became clear, and the hours wore on, several Republicans suggested his recollections could not be trusted.

He had complained at the start of the daylong hearing that he couldn’t remember some details because the White House and State Department had refused to provide his emails, call logs and other documents that his lawyers had requested.

In a second hearing Wednesday evening, Laura Cooper, a deputy assistant secretary of Defense, knocked down another Republican argument.

She testified that her staff first fielded questions in two emails from Ukrainian officials “asking what was going on with the Ukraine security assistance” on July 25, the same day Trump and Zelensky spoke by phone and a month before the government in Kyiv was thought to have been aware of the suspension.

The timing is significant because Republicans argue that the administration had no leverage until the Ukrainians knew the promised weapons and other military aid were at risk.

Sondland said he spoke to Trump approximately six times about Ukraine but about 20 times overall, and he laughed near the end of the marathon hearing when informed that Trump told reporters that he barely knew his ambassador. Sondland earlier had testified that they were comfortable enough together that their banter often included “four-letter” words.

But Sondland made clear he would not be a fall guy for an operation that, in his telling, involved Vice President Mike Pence, Energy Secretary Rick Perry, Secretary of State Michael R. Pompeo, acting White House Chief of Staff Mick Mulvaney and others.

“Everyone was in the loop,” he said. “It was no secret.”

He said that he specifically told Pence before he met with Zelensky on Sept. 1 in Warsaw that “I had concerns that the delay in aid had become tied to the issue of investigations.”

He said the vice president “heard what I said. But I don’t recall any substantive response.”

Sondland placed Giuliani at the center of the effort, saying that the former New York mayor told him directly — as well as through Kurt Volker, a special U.S. envoy to Ukraine —– that Trump wouldn’t agree to meet with Zelensky at the White House unless he announced the investigations that Trump wanted.

He testified that the investigations needed to include the 2016 election as well as Burisma, a Ukrainian natural gas company that had hired Biden’s son Hunter. Sondland said he later understood the inclusion of “Burisma” to mean investigating the Bidens.

Sondland, like several previous witnesses, was sharply critical of Giuliani’s role.

He said Trump told him and others in an Oval Office meeting on May 23 that Giuliani should be their point man on Ukraine. Sondland interpreted that to mean that Giuliani spoke for the president when discussing the investigations.

“When the president says, ‘Talk to my personal attorney,’ and then Mr. Giuliani makes certain requests or demands, we assume that’s coming from the president,” Sondland said.

“We weren’t happy with the president’s directive to talk with Rudy. We did not want to involve Mr. Giuliani,” Sondland said.

“I believed then, as I do now, that the men and women of the State Department, not the president’s personal lawyer, should take responsibility for Ukraine matters,” he said.

Sondland offered only tentative support for a crucial part of the Democrats’ case: that the White House had frozen $391 million in security aid as additional leverage to get Ukraine to investigate Trump’s foes. Sondland said that he never heard Trump make the connection but that he “presumed” it was based on circumstantial evidence.

“I don’t recall President Trump ever talking with me about any security assistance,” he said. But he added that the link was “abundantly clear” to U.S. officials dealing with Ukraine.

“In the absence of any credible explanation for the suspension of aid, I later came to believe that the resumption of security aid would not occur until there was a public statement from Ukraine committing to the investigations of the 2016 election and Burisma, as Mr. Giuliani had demanded,” Sondland said.

Pence, Pompeo, Perry and Giuliani all issued statements or tweets denying aspects of Sondland’s testimony.

Marc Short, Pence’s chief of staff, issued a statement saying Sondland’s account of a conversation with the vice president in Poland “never happened.” A State Department spokeswoman said Sondland never told Pompeo “that he believed the president was linking aid to investigations of political opponents.”

Republican lawmakers in the hearing argued that Sondland kept changing his story.

“You don’t have records. You don’t have your notes because you didn’t take notes. You don’t have a lot of recollections,” said Stephen Castor, the Republican counsel who asked questions on behalf of lawmakers. “This is like the trifecta of unreliability, isn’t that true?”

“I think I’ve filled in a lot of blanks,” Sondland responded.

“You do not have any evidence that the president of the United States [tied] withholding aid from Ukraine in exchange for investigations,” Rep. Michael R. Turner (R-Ohio) said.

Two more witnesses are scheduled to testify Thursday before Congress leaves for the Thanksgiving holiday, and both Republicans and Democrats latched onto Sondland’s testimony.

Rep. Adam B. Schiff (D-Burbank), chairman of the House Intelligence Committee, said Sondland’s account goes “right to the heart” of Democrats’ claims that Trump could be impeached for bribery, as well as other high crimes and misdemeanors.

Trump, for his part, tried to distance himself from Sondland, who had donated $1 million to the president’s inauguration.

“I don’t know him very well,” Trump said as he left the White House. “I have not spoken to him much. This is not a man I know well. He seems like a nice guy, though.”

Although he appeared relaxed, even amused at times, Sondland shared a heated exchange with Rep. Sean Patrick Maloney (D-N.Y.), who demanded that Sondland say who would benefit from an investigation of the Bidens: Trump.

Maloney mockingly said that that answer “didn’t hurt a bit.”

“I’ve been very forthright and I really resent what you’re trying to do,” Sondland said.

Sondland pushed back against statements by several previous witnesses, career diplomats or national security professionals who had accused him and other senior political appointees of operating a “shadow foreign policy” outside normal State Department channels.

He insisted that he, Volker and Perry — who had dubbed themselves the “Three Amigos” — were acting at the behest of the White House and were not running a rogue operation.

By Sondland’s account, “everyone” understood the message to the Ukrainians.

He presented an excerpt from a July 19 email sent to Perry, Pompeo and Mulvaney, among others, in which Sondland said Zelensky assured him an investigation would be announced. Mulvaney replied that he asked the National Security Council to set up a call between Trump and Zelensky for the next day.

Sondland undermined his testimony, however, by repeatedly citing gaps in his memory and claiming that concerns about the requests for the Ukrainian investigations did not reach him.

The U.S. ambassador to Ukraine, William B. Taylor Jr., testified this week that he had complained directly to Sondland, texting him that linking military aid to Trump’s reelection campaign was “crazy.”

“Everyone’s hair was on fire but no one decided to talk to us,” Sondland said.

He offered few new details of his conversations with Trump, including a July 26 cellphone call that he placed to the president from a restaurant in Kyiv.

David Holmes, a State Department official who is scheduled to testify Thursday, said in earlier testimony behind closed doors that he overheard Trump ask Sondland on the call about the “investigations.” The testimony was later released.

Holmes said Sondland later told him that Trump didn’t care about Ukraine and was more focused on getting the investigations of the Bidens, which could benefit him politically.

Sondland said he didn’t recall the conversation, chalking it up to the fact that he spoke frequently with the president or other political leaders.