Michael McKinley, a former senior adviser to Secretary of State Mike Pompeo, told House impeachment investigators Wednesday that he quit his job last week out of concern about the mistreatment of career U.S. diplomats and the alarming allegations related to efforts to pressure Ukraine’s president into investigating President Trump’s political rivals.

“I was disturbed by the implication that foreign governments were being approached to procure negative information on political opponents,” McKinley said, according to portions of his testimony obtained by The Washington Post. “I was convinced that this would also have a serious impact on Foreign Service morale and the integrity of our work overseas.”

The remarks represent a significant rebuke of Trump’s dealings in Ukraine, from a senior official who worked closely with Pompeo and served as a link between the top diplomat and the rest of the Foreign Service. Trump has denied that he withheld diplomatic engagement and military assistance to Ukraine in order to pressure the country into investigating former vice president Joe Biden and his son Hunter, who worked for a Ukrainian energy company.

But McKinley said he had to leave his job because of “what appears to be the utilization of our ambassadors overseas to advance domestic political objectives” and the failure to “offer support to Foreign Service employees caught up in the Impeachment Inquiry on Ukraine.”

McKinley said his concerns culminated with the recall of the U.S. ambassador to Ukraine, Marie Yovanovitch, a punitive action he and many other rank-and-file diplomats viewed as wholly unjustified, said people familiar with his testimony who spoke on the condition of anonymity to discuss the closed-door meeting with lawmakers.

“The unwillingness of State Department leadership to defend Yovanovitch or interfere with an obviously partisan effort to intervene in our relationship with Ukraine for the political benefit of the president was too much for him,” said one person familiar with McKinley’s testimony.

McKinley wanted Pompeo or the department to issue a “supportive statement” for Yovanovitch but it never happened, and McKinley told investigators he did not want to be part of a department that did not support its diplomats, said another person familiar with the testimony.

McKinley’s last day was Friday, though he had informed Pompeo more than a week earlier that he was resigning. The split has been bitter, as shown by the absence of a statement from Pompeo expressing gratitude for McKinley’s 37 years of service.

McKinley came to Capitol Hill with an intimate understanding of how Pompeo wielded power in the highest echelons of the State Department, but he said he was not particularly involved in Ukraine-related issues. McKinley flew on Pompeo’s plane, advised him on a broad array of issues and used his connections throughout the Foreign Service to help Pompeo take the temperature of the building.

Pompeo has prided himself in bringing the State Department’s “swagger back” following a dip in morale under his predecessor, Rex Tillerson, but lately the catchphrase has elicited ridicule as the secretary faces questions about his loyalty to career diplomats.

McKinley’s testimony came as the House impeachment inquiry digs deeper into the actions of Trump’s top diplomat, who has lasted longer than any other member of the president’s national security team.

Trump on Wednesday expressed frustration with the growing list of U.S. officials testifying before House investigators, saying House Speaker Nancy Pelosi (D-Calif.) is issuing subpoenas with abandon.

“Nancy Pelosi hands them out like cookies,” he told reporters in the Oval Office as he sat beside Italian President Sergio Mattarella. “I have all these people testifying. . . . I don’t even know these people.”

Trump reiterated a complaint shared by House Republicans that the depositions are being conducted behind closed doors without the presence of White House or State Department lawyers.

“We’re not allowed to representation,” Trump said. “We’re not allowed to lawyers. We’re not allowed to have anything.”

McKinley underscored an August report by the State Department’s inspector general concluding that the Trump administration’s political appointees bullied staffers and accused them of political disloyalty to the president, said a person familiar with his testimony.

The report condemned Kevin Moley, the assistant secretary in charge of the Bureau of International Organization Affairs, and his former senior adviser, Mari Stull. She is a former lobbyist and consultant for the food and agricultural industry who left the department early this year after reports in Foreign Policy and other media outlets revealed she had compiled a list of employees she considered insufficiently loyal to Trump. Moley still holds his position, and officials have said Pompeo lacks the authority to dismiss political appointees, which diplomats say is not true.

The State Department accepted the recommendation of the report in August and said it would submit a “corrective action plan” within 60 days, but that deadline has passed. Officials have also said there is a second inspector general report that is critical of the firing of State Department officials under Pompeo’s top Iran hand, Brian Hook, but that report has not been released yet.

McKinley, a career diplomat and Latin America specialist, has served in several senior diplomatic posts, including as ambassador to Afghanistan, Colombia and Peru. He was serving as ambassador to Brazil last year when Pompeo recruited him as a policy adviser and a conduit between his office and the career service.

The testimony of McKinley, who occupied the seventh-floor office next to Pompeo, could do more to clarify for lawmakers persistent questions about the secretary’s role in the effort to pressure Ukraine to investigate Biden and the abrupt removal of Yovanovitch in the spring. Ahead of her ouster, the president’s personal attorney Rudolph W. Giuliani waged a campaign against Yovanovitch, accusing her of trying to protect Biden and his son from a Ukrainian investigation and harboring an improper loyalty to liberal billionaire George Soros.

In her testimony last week, Yovanovitch denied those allegations and said she was “incredulous” that her superiors decided to remove her based on “unfounded and false claims by people with clearly questionable motives.” She also took direct aim at Giuliani’s associates, whom she said could have been financially threatened by her anti-corruption efforts in Ukraine.

Current and former State Department officials have said Pompeo did little to stop her removal from the job.

“They fired her in the most dishonorable way imaginable,” said one former State Department official who spoke on the condition of anonymity to discuss internal processes.

Pompeo has defended his actions, saying in an interview with the news outlet the Tennessean on Friday: “I protect every single State Department employee. It’s one of the reasons that we asked the House of Representatives to stop their abusive prosecutions where they won’t let State Department lawyers sit with our employees.”

But Pompeo’s suggestion that he is doing diplomats a favor by pushing back against congressional requests to interview them has not been celebrated or even welcomed in some cases. Instead, several current and former U.S. officials have openly defied White House orders to avoid testifying before House investigators, choosing instead to defend their actions and describe the role of other Trump officials as the House issues subpoenas for their attendance. On Thursday, the U.S. ambassador to the European Union, Gordon Sondland, a central figure in the effort to push Ukraine to open the investigations, is expected to appear on Capitol Hill.

Pompeo’s status as the most trusted adviser in Trump’s Cabinet has led many in the building to question why he could not expend that capital to defend Yovanovitch or to thank a career diplomat on his way out the door.

“It is so indicative of how fragile the secretary’s relationship with the president is, even though he is the favored one in the national security environment,” said one of the people familiar with McKinley’s testimony, stressing that this was a personal observation, not McKinley’s. “The secretary felt he could not praise Mike or thank him publicly, just as he could not stand up for Yovanovitch, who was obviously the subject of a diplomatic mugging.”

Karen DeYoung, Karoun Demirjian, Rachael Bade and Josh Dawsey contributed to this report.