WASHINGTON—President 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...