WASHINGTON — Marie Yovanovitch, the ousted U.S. ambassador to Ukraine, told House impeachment investigators Friday that President Donald Trump had personally pressured the State Department to remove her, even though a top department official assured her that she had "done nothing wrong."

Yovanovitch said that after she was abruptly recalled from her post in the spring, Deputy Secretary of State John Sullivan told her that the president had lost confidence in her, according to her prepared remarks.

"He added that there had been a concerted campaign against me, and that the department had been under pressure from the president to remove me since the summer of 2018," Yovanovitch said.

"He also said that I had done nothing wrong and that this was not like other situations where he had recalled ambassadors for cause," she added.

Yovanovitch, a career diplomat who said she was informed of her ouster in April, said in her statement that she was "incredulous that the U.S. government chose to remove an ambassador based, as best as I can tell, on unfounded and false claims by people with clearly questionable motives."

Download the NBC News app for the latest on the impeachment inquiry

She warned that allowing misinformation to subvert U.S. diplomats like herself would "harm" the U.S.

"The harm will come when private interests circumvent professional diplomats for their own gain, not the public good," she said. "The harm will come when bad actors in countries beyond Ukraine see how easy it is to use fiction and innuendo to manipulate our system."

After more than 9 hours, Yovanovitch departed the closed-door deposition Friday night.

Her appearance before the House Intelligence, Oversight and Foreign Affairs Committees came as part of their investigations into Trump’s efforts to persuade Ukraine's new government to commit publicly to investigate corruption and the president's political opponents.

It had been unclear right up until Yovanovitch arrived whether she would appear because she still works for the State Department. The White House had vowed that administration officials would not cooperate with the impeachment probe.

Hours into her testimony, the chairmen of the three committees released a statement saying that the State Department, at the behest of the White House, had directed her not to appear for her voluntary interview. In response, the House Intelligence Committee issued a subpoena to compel her Thursday night.

"This duly authorized subpoena is mandatory, and the illegitimate order from the Trump Administration not to cooperate has no force. As is required of her, the Ambassador is now complying with the subpoena and answering questions from both Democratic and Republican members and staff," Rep. Adam Schiff, the chairman of the Permanent Select Committee on Intelligence, Rep. Elijah Cummings, the chairman of the Committee on Oversight and Reform and Rep. Eliot Engel, the chairman of the Committee on Foreign Affairs, said.

"Any efforts by Trump Administration officials to prevent witness cooperation with the Committees will be deemed obstruction of a co-equal branch of government and an adverse inference may be drawn against the President on the underlying allegations of corruption and coverup," the chairs added.

Rep. Eleanor Holmes Norton, D.C.'s nonvoting House delegate and a member of the Oversight Committee, said Yovanovitch was "acting like a true ambassador."

"She herself has been deeply involved and has been the object of false statements, and she's clearing that up," Holmes Norton said.

Holmes Norton added that "both sides are finding her very credible," and Yovanovitch had not indicted that anyone attempted to prevent her from answering questions from lawmakers as expected Friday.

Asked about whether Yovanovitch had spoken about Trump's personal lawyer, Rudy Giuliani, Holmes Norton said, "That is becoming very, very deep."

Yovanovitch had previously been scheduled to be deposed by the committees on Oct. 2, but the appearance was postponed.

In a letter to House Democrats last week, Secretary of State Mike Pompeo pushed back against Democrats' request to interview five current and former State Department employees, including Yovanovitch.

Yovanovitch has emerged as a potentially key figure in the investigation by House Democrats.

In Trump's July 25 phone call with Ukrainian President Volodymyr Zelenskiy, Trump referred to Yovanovitch as "bad news."

She departed Ukraine in May, months ahead of her scheduled departure, after coming under attack from right-wing media, who alleged she was hostile to the president. Her departure set off alarm bells among Democrats in Congress but the State Department said at the time her exit was planned.

According to the intelligence community whistleblower complaint at the heart of Democrats' impeachment inquiry, Yovanovitch's tenure was cut short because she had run afoul of the then-prosecutor general in Ukraine, Yuri Lutsenko, and Giuliani. Lutsenko at one point alleged she had given him a "do not prosecute" list. The State Department has said the assertion was an outright fabrication and Lutsenko himself later walked back his comments.

Yovanovitch, according to her prepared remarks, addressed Lutsenko's since-recanted allegation, telling lawmakers that she wanted to "categorically state that I have never myself or through others, directly or indirectly, ever directed, suggested, or in any other way asked for any government or government official in Ukraine (or elsewhere) to refrain from investigating or prosecuting actual corruption."

She added, "As Mr. Lutsenko, the former Ukrainian Prosecutor General has recently acknowledged, the notion that I created or disseminated a 'do not prosecute' list is completely false — a story that Mr. Lutsenko, himself, has since retracted."

She also called the notion that she was "disloyal" to Trump "fictitious," and said she did not know Giuliani's motives for attacking her.

"But individuals who have been named in the press as contacts of Mr. Giuliani may well have believed that their personal financial ambitions were stymied by our anti-corruption policy in Ukraine," she told House investigators, according to her statement.

Two foreign-born associates of Giuliani — Igor Fruman and Lev Parnas — who gave money to a political action committee supporting Trump were arrested Wednesday night on criminal charges tied to an alleged effort to influence U.S. politics with illegal campaign contributions. Giuliani has previously said that Fruman and Parnas worked with him as part of his dealings in Ukraine that involved efforts to encourage that nation to investigate former Vice President Joe Biden and his son Hunter.

The indictment also detailed a push by Parnas and Fruman to oust Yovanovitch, efforts at least partially on behalf of an unnamed Ukrainian official.

Trump, when asked Friday if Giuliani was still his attorney, said, "Well, I don't know."

"I haven't spoken to Rudy. I spoke to him yesterday briefly. He’s a very good attorney and he has been my attorney, yeah sure," the president told reporters on the White House South Lawn.

Of Yovanovitch, Trump said, "She may be a wonderful woman, I don't know her."

"But she may be very much a wonderful woman," he continued. "If you remember the phone call I had with the [Ukraninan] president, the new president, he didn’t speak favorably. But I just don’t know her. She may be a wonderful woman."

According to the White House summary of the call, Zelenskiy said it was Trump who first informed him that Yovanovitch was a "bad ambassador."

"It was great that you were the first one who told me that she was a bad ambassador because I agree with you 100 percent. Her attitude towards me was far from the best as she admired the previous president and she was on his side. She would not accept me as a new president well enough," Zelenskiy said, according to the White House.

Yovanovitch's former colleagues have described her as one of the State Department's most talented and conscientious diplomats, and that it would be totally out of character for her to engage in partisan politics.

During her tenure, Yovanovitch was outspoken in her calls for Ukraine to tackle corruption, a stance in keeping with U.S. policy over successive administrations.

After Yovanovitch gave a tough speech in March urging the government to sack a senior anti-corruption official, she came under fire from Lutsenko, conservative voices in the U.S. and the president's eldest son, Donald Trump Jr.