A career diplomat who served as senior advisor to Secretary of State Mike Pompeo has decided to step down, two State Department officials told NBC News on Thursday, just as foreign service officers find themselves caught in the middle of a confrontation between the White House and Democratic lawmakers leading an impeachment inquiry.

P. Michael McKinley, a seasoned foreign service officer who served as ambassador to Afghanistan, Colombia, Brazil and Peru, has told his colleagues he is resigning, the two officials said.

McKinley's resignation was first reported by The Washington Post.

The State Department did not respond to requests for comment.

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

The move comes amid growing concern among career diplomats over how the administration has handled the impeachment inquiry on Ukraine and how it has treated career civil servants who have been asked to testify before Congress. Earlier this week, Pompeo at the last minute barred the U.S. ambassador to the European Union, Gordon Sondland, from appearing before House lawmakers.

Foreign service officers have come away disheartened by revelations in the Ukraine case, including the recall of Marie Yovanovitch as ambassador to Ukraine months ahead of schedule, after she came under attack from right-wing media. Yovanovitch has been asked to appear before House committees as well but it remains unclear if the State Department will allow her to testify.

In text messages released last week, the top diplomat in Kyiv, who succeeded Yovanovitch, William Taylor, expressed alarm that the Trump administration appeared ready to withhold military aid to Ukraine if the government did not agree to conduct investigations to benefit the president’s personal political agenda.

Former diplomats have blasted the Trump administration over plummeting morale at the State Department and accused the White House of sidelining career civil servants while pushing them to take sides in its political clashes.

The American Foreign Service Association, which represents the State Department workforce, recently issued an unusual statement warning against attempts to inject politics into the non-partisan diplomatic corps.

“Our members have taken an oath to the U.S., and do their utmost to support the foreign policy of the United States under the leadership of the elected leaders of our democracy,” it said.

“We urge that their service, which at times is under the most serious hardship conditions and security risks, not be politicized and that they not be dragged into partisan political battles.”