Former US Ambassador to Ukraine Marie Yovanovitch appeared before lawmakers Friday — where she denied allegations she tried to thwart a corruption probe but said she was told the president wanted her gone.

Speaking to House impeachment investigators behind closed doors, Yovanovitch said in her opening statements she never “directed, suggested, or in any other way asked for any government or government official in Ukraine … to refrain from investigating or prosecuting actual corruption.”

The career diplomat said she was dismissed in May and told to be gone “on the next plane.”

Later, a State Department official told Yovanovitch she had done nothing wrong but that Trump pushed for her removal after a campaign to convince him she should go, she said.

“He said that the president had lost confidence in me and no longer wished me to serve as his ambassador.

“He added that there had been a concerted campaign against me. He also said that I had done nothing wrong.”

According to multiple reports, Trump’s lawyer Rudy Giuliani and others — including one of the two Soviet-born Giuliani associates arrested by the feds on Thursday for alleged campaign finance violations — had pressed for Yovan­ovitch’s removal.

Yovanovitch said she worried that the State Department had become “hollowed out” during the Trump administration and the harm she saw could encourage “bad actors” who see “how easy it is to use fiction and innuendo to manipulate our system” to the point where only the interests of “adversaries like Russia” will be served.

She denied allegations that she had been disloyal to Trump — or that she told staffers to ignore him because he was going to be impeached.

“Equally fictitious … I have never said such a thing, to my Embassy colleagues or to anyone else,” she said.

The president described Yovanovitch as “bad news” in his July 25 phone call with Ukrainian President Volodymyr Zelensky, in which he asked his counterpart to open an investigation into Joe Biden and his son Hunter’s relationship to a natural gas company in the Ukraine.

A whistleblower’s complaint about the call prompted the House to open an impeachment inquiry into Trump.

Yovanovitch said Friday she never met Hunter and that in her dealings with the former vice president he had never mentioned the gas firm.

She also said she had only minimal contact with Giuliani and that the Bidens were never mentioned.

Trump and Giuliani have alleged that Joe Biden pressured Ukraine to fire a prosecutor who was investigating Hunter’s company.

Yovanovitch’s opening remarks were released publicly, but she continued speaking with lawmakers privately into Friday afternoon.