WASHINGTON — A former top aide to Secretary of State Mike Pompeo told Congress on Wednesday that he resigned amid mounting frustrations with the Trump administration’s sidelining of career diplomats on Ukraine policy and its failure to support them in the face of the impeachment inquiry.

In several hours of closed-door testimony, Michael McKinley, who until last week was a senior adviser to Mr. Pompeo, described his disappointment with how politicized the State Department had become under President Trump, saying that the last straw for him stemmed from the ouster of Marie L. Yovanovitch, the former ambassador to Ukraine whom Mr. Trump ordered removed.

According to a copy of his opening remarks reviewed by The New York Times, Mr. McKinley said that after reading in late September that President Trump had disparaged Ms. Yovanovitch as “bad news” on a July phone call with the Ukrainian leader, he had tried to get top State Department officials to publicly laud Ms. Yovanovitch for her “professionalism and courage.” He said he ultimately received no meaningful response, no statement was issued and he decided to step down.

“The timing of my resignation was the result of two overriding concerns: the failure, in my view, of the State Department to offer support to Foreign Service employees caught up in the impeachment inquiry on Ukraine,” Mr. McKinley said in an opening statement. “And, second, by what appears to be the utilization of our ambassadors overseas to advance a domestic political objective.”