WASHINGTON — President Donald Trump ordered the removal of the ambassador to Ukraine after months of complaints from allies outside the administration, including his personal lawyer Rudy Giuliani, that she was undermining him abroad and obstructing efforts to persuade Kyiv to investigate former Vice President Joe Biden, according to people familiar with the matter.

The recall of Marie Yovanovitch in the spring has become a key point of interest in the House impeachment inquiry. A whistleblower complaint by a CIA officer alleges the president solicited foreign interference in the 2020 elections by pressing Ukraine’s president in a July 25 call to pursue investigations, including into the activities of Biden, a Democrat who is running for president.

The complaint cites Yovanovitch’s ouster as one of a series of events that paved the way for what the whistleblower alleges was an abuse of power by the president. Trump has described the call with his Ukrainian counterpart as “perfect” and the House inquiry as a “hoax.”

State Department officials were told this spring that Yovanovitch’s removal was a priority for the president, a person familiar with the matter said. Secretary of State Mike Pompeo supported the move, an administration official said. Yovanovitch was told by State Department officials that they couldn’t shield her from attacks by the president and his allies, according to people close to her.

In an interview, Giuliani told The Wall Street Journal that in the lead-up to Yovanovitch’s removal, he reminded the president of complaints percolating among Trump supporters that she had displayed an anti-Trump bias in private conversations. In Giuliani’s view, she also had been an obstacle to efforts to push Ukraine to investigate Biden and his son, Hunter.

An expanded version of this report appears on WSJ.com.

Also popular on WSJ.com:

The seven-year auto loan: America’s middle class can’t afford its cars.

‘Active interest’: Insurance tycoon spied on women who caught his eye.