WASHINGTON — In riveting testimony, a former national security official declared Thursday that a U.S. ambassador carried out a controversial "domestic political errand" for Donald Trump on Ukraine, an allegation undercutting a main line of the president’s defense in the impeachment inquiry.

Fiona Hill told House investigators she came to realize Ambassador Gordon Sondland wasn’t simply operating outside official diplomatic channels, as she and others suspected, but carrying out instructions from Trump.

“He was being involved in a domestic political errand, and we were being involved in national security foreign policy," she testified, “and those two things had just diverged.”

Hill’s comment followed a blistering back-and-forth during questioning from Republicans at the House hearing.

Testimony from Hill and David Holmes, a State Department adviser in Kyiv, capped an intense week in the historic inquiry and reinforced the central complaint: that Trump used foreign policy for political aims, setting off alarms across the U.S. national security and foreign policy apparatus.

RELATED: Sondland: Trump directed Ukraine quid pro quo

RELATED: Republicans holding together in wake of impeachment testimony

Democrats allege Trump was relying on the discredited idea that Ukraine rather than Russia interfered in the 2016 U.S. election as he sought investigations in return for two things: U.S. military aid that Ukraine needed to fend off Russian aggression, and a White House visit the new Ukrainian president wanted that would demonstrate his backing from the West.

One by one, Hill, a Russia expert at the White House’s National Security Council until this summer, took on Trump’s defenses.

She and Holmes both told House investigators it was abundantly clear Trump’s lawyer Rudy Giuliani was pursuing political investigations of Democrats and Joe Biden in Ukraine.

The House probe focuses on allegations that Trump sought investigations of Joe Biden and his son — and the discredited idea that Ukraine rather than Russia interfered in the 2016 U.S. election — in return for U.S. military aid that Ukraine needed to fend off Russian aggression, and for a White House visit the new Ukrainian president wanted that would demonstrate his backing from the West.

Hill a former White House Russia analyst, sternly warned Republican lawmakers — and implicitly Trump — to quit pushing the “fictional” Ukraine-interference narrative as they defend Trump in the impeachment inquiry.

Holmes, a late addition to the schedule, testified that he came forward after overhearing Trump ask about “investigations” during a “colorful” phone call with Ambassador Gordon Sondland at a Kyiv restaurant this summer. 

“He was clearly pushing forward issues and ideas that would, you know, probably come back to haunt us and in fact,” Hill testified. “I think that's where we are today."

And Hill stood up for Lt. Col. Alexander Vindman, the Army officer who testified earlier and whom Trump’s allies tried to discredit.” He remains at the White House National Security Council.

At one point, Republicans interjected, trying to cut off Hill’s response as she flipped the script during the afternoon of questioning. The GOP lawmakers had been trying to highlight her differences with Sondland, the ambassador to the European Union who delivered damaging testimony Wednesday about what he said was Trump’s “quid pro quo” pursuit of the political investigations.

“You may not like the witness’ answer, but we will hear it,” said Rep. Adam Schiff, the Democratic chairman of the committee.

The Republican lawmakers eventually wound down their questions but continued with mini-speeches decrying the impeachment effort. Democrats, in turn, criticized Trump’s actions.

Hill, a former aide to then-national security adviser John Bolton, sternly warned Republican lawmakers — and implicitly Trump — to quit pushing a “fictional” narrative that Ukraine, rather than Russia, interfered in U.S. elections.

Trump has told others testifying in the inquiry that Ukraine tried to “take me down” in the 2016 election. Republicans launched their questioning Thursday reviving those theories.

Hill declared: “I refuse to be part of an effort to legitimize an alternative narrative that the Ukrainian government is a U.S. adversary, and that Ukraine — not Russia — attacked us in 2016.”

Her testimony also raised fresh questions whether Bolton, who has yet to defy White House orders for officials not to testify, would appear in the inquiry. In what was seen as a nudge to her former boss, Hill said those with information have a “moral obligation to provide it.”

The landmark House impeachment inquiry was sparked by a July 25 phone call, in which Trump asked Ukraine President Volodymyr Zelenskiy for investigations into Biden and the Democratic National Committee. A still-anonymous whistleblower’s official government complaint about that call led the House to launch the current probe.

Hill and Holmes both filled in gaps in previous testimony and poked holes in the accounts of other witnesses. They were particularly adamant that efforts by Trump and Giuliani to investigate the Burisma company were well-known by officials working on Ukraine to be the equivalent of probing the Bidens. That runs counter to earlier testimony from Sondland and Kurt Volker, the former Ukraine special envoy, who insisted they had no idea there was a connection.

Holmes, a late addition to the schedule, also undercut some of Sondland’s recollections about an extraordinary phone call between the ambassador and Trump on July 26, the day after the president’s call with Ukraine. Holmes was having lunch with Sondland in Kyiv and said he could overhear Trump ask about “investigations” during a “colorful” conversation.

After the phone call, Holmes said Sondland told him Trump cared about “big stuff,” including the investigation into the “Biden investigation.” Sondland said he didn’t recall raising the Bidens.

During Thursday’s testimony, the president tweeted that while his own hearing is “great” he’s never been able to understand another person’s conversation that wasn’t on speaker. “Try it,” he suggested.

Holmes also testified about his growing concern as Giuliani orchestrated Ukraine policy outside official diplomatic channels. It was a concern shared by others, he testified.

“My recollection is that Ambassador Sondland stated, “Every time Rudy gets involved he goes and f---s everything up.”

Holmes testified that he grew alarmed throughout the year, watching as Giuliani was “making frequent public statements pushing for Ukraine to investigate interference in the 2016 election and issues related to Burisma and the Bidens.”

Hill left the White House before the July phone call that sparked the impeachment probe, though she was part of other key meetings and conversations related to Ukraine policy. She opened her testimony with an impassioned plea for Republicans to stop peddling an alternative theory of 2016 election interference and helping Russia sow divisions in the United States.

“This is exactly what the Russian government was hoping for,” she said about the currently American political climate. “They would pit one side of our electorate against the others.”

She warned that Russia is gearing up to intervene again in the 2020 U.S. election. “We are running out of time to stop them,” she testified.

Trump — as well as Republicans on the panel, including ranking GOP Rep. Devin Nunes of California — continue to advance the idea that Russian interference was a “hoax,” and that it was Ukraine that was trying to swing the election, to stop Trump’s presidency.

“That is the Democrats’ pitiful legacy,” Nunes said in his opening remarks. He called it all part of the same effort, from “the Russia hoax” to the “shoddy sequel” of the impeachment inquiry.

Hill, who became a U.S. citizen in 2002, told lawmakers she was the daughter of a coal miner in the northeast of England, noting it is the same region George Washington’s ancestors came from.

Hill said Bolton told her separately he didn’t want to be involved in any “drug deal” Sondland and Trump’s acting White House chief of staff Mick Mulvaney were cooking up over the Ukrainian investigations Trump wanted.

In Moscow on Wednesday, Russian President Vladimir Putin said he was pleased that the “political battles” in Washington had overtaken the Russia allegations, which are supported by the U.S. intelligence agencies.

"Thank God,” Putin said, “no one is accusing us of interfering in the U.S. elections anymore. Now they’re accusing Ukraine."