The top U.S. diplomat for Ukraine, Bill Taylor, will leave his post at the end of the year, a current and a former U.S. official told NBC News on Tuesday.

Taylor, who questioned the White House’s decision to withhold an Oval Office meeting with the Ukrainian president and military aid for Kyiv, was a key witness in the congressional impeachment inquiry into President Donald Trump.

Under the Vacancies Act, he could have remained as the acting ambassador until Jan. 8, a person familiar with Taylor's plans told NBC News. Instead, Taylor will turn over the position to the current Deputy Chief of Mission to Ukraine, Kristina Kvien, on Jan. 1 and will leave the country on Jan. 2.

Trump has castigated diplomats who testified in the inquiry, calling them “Never Trumpers,” and it’s highly unlikely Pompeo would set foot in Kyiv until Taylor has left the post.

“Pompeo is not going to want to be in a photo with Taylor,” one congressional aide said.

It is also unclear who will replace Taylor, who was serving as the acting ambassador but had never been formally nominated for Senate confirmation. There has been no permanent ambassador to Ukraine since career diplomat Marie Yovanovitch was forced out in May following attacks in the right-wing media and critical comments from Trump’s personal lawyer, Rudy Giuliani.

Download the NBC News app for breaking news and politics

The events surrounding Yovanovitch’s removal from office and the smear campaign waged against her by Giuliani and his associates have been central to the impeachment, which is expected to go to a full House vote Wednesday after the Judiciary Committee voted last week to approve two articles of impeachment accusing Trump of abuse of power and obstruction of Congress.

Taylor, a decorated Vietnam War veteran and a longtime diplomat, has served under every U.S. president since 1985. An ambassador to Ukraine under President George W. Bush, Taylor was brought in by Pompeo in June to fill the vacancy.

Upon his arrival, Taylor told Congress, “I found a confusing and unusual arrangement for making U.S. policy towards Ukraine.”

It quickly became clear to Taylor that nearly $400 million in military aid was being withheld from Ukraine on the condition that the country's president, Volodymyr Zelenskiy, publicly commit to investigating former Vice President Joe Biden’s son Hunter for his role at the Burisma energy company and a debunked conspiracy theory about alleged Ukrainian interference in the 2016 U.S. election.

As the summer wore on, Taylor’s concerns grew and by early September, he expressed them in a text message to the then-special envoy to Ukraine, Kurt Volker, and the ambassador to the European Union, Gordon Sondland. “As I said on the phone, I think it's crazy to withhold security assistance for help with a political campaign.”

The text messages are seen by Democrats as a key piece of evidence that Trump was involved in a quid pro quo.

Giuliani has continued to attack Yovanovitch, tweeting Monday that she was allegedly “obstructing justice” and enabling “Ukrainian collusion.” Giuliani offered no detailed evidence to back up his assertions. The U.S. intelligence community concluded that Russia interfered in the 2016 election, not Ukraine as Guiliani has alleged.

In her testimony to Congress, Yovanovitch said she had served presidents from both parties throughout her career and always conducted her work in a strictly nonpartisan manner. Yovanovitch said she was confused and troubled when she came under attack by Giuliani. When she learned that Trump had denigrated her in a July phone call to Zelenskiy, she said she was “shocked, appalled, devastated that the president of the United States would talk about any ambassador like that to a foreign head of state — and it was me. I mean, I couldn’t believe it.”

The State Department did not immediately respond to a request for comment. Taylor also declined to comment.

CORRECTION (Dec. 17, 2019, 4:10 p.m.): An earlier version of this story incorrectly stated when Taylor is required to exit his post. He could have stayed on until Jan. 8, not Jan. 1.