WASHINGTON (Reuters) - U.S. Ambassador to Panama John Feeley, a career diplomat and former Marine Corps helicopter pilot, has resigned, saying he no longer felt able to serve President Donald Trump.

Feeley’s departure had been communicated to State Department officials on Dec. 27 and was not a response to Trump’s alleged use of the word “shithole” to describe Haiti and African countries at a meeting on Thursday, U.S. officials said.

Trump denies using the term.

Feeley, one of the department’s Latin America specialists and among its senior most officers, made clear that he had come to a place where he no longer felt able to serve under Trump.

“As a junior foreign service officer, I signed an oath to serve faithfully the president and his administration in an apolitical fashion, even when I might not agree with certain policies,” Feeley said, according to an excerpt of a resignation letter read to Reuters on Friday.

“My instructors made clear that if I believed I could not do that, I would be honor bound to resign. That time has come.”

A State Department spokeswoman confirmed Feeley’s departure, saying that he “has informed the White House, the Department of State, and the Government of Panama of his decision to retire for personal reasons, as of March 9 of this year.”

Speaking to reporters, Under Secretary of State Steve Goldstein said he was aware of Feeley’s planned departure on Thursday morning, before Trump’s alleged use of the vulgar term, and said the ambassador was leaving for “personal reasons.”

“Everyone has a line that they will not cross,” “Goldstein told reporters at the State Department. “If the ambassador feels that he can no longer serve ... then he has made the right decision for himself and we respect that.”

U.S. officials declined to discuss Feeley’s reasons for leaving the department after a long career, much of which was spent working on Latin American issues.

Some of Trump’s policies have been widely regarded within the region as hostile to Latin America.

The Trump administration has taken a tougher stance on immigration from Latin America, most notably with moves to expel hundreds of thousands of immigrants from El Salvador, Haiti and Nicaragua who benefited from temporary protection status after natural disasters.

Feeley’s career included serving as the No. 2 official in the State Department bureau that deals with Latin America, as deputy chief of mission at the U.S. embassy in Mexico City and as director for Central American affairs in Washington.