U.S. ambassador to Panama John Feeley has resigned after deciding he can no longer carry out his mission to advance the Trump administration's goals, the State Department confirmed Friday.

A State Department spokesperson told the Washington Examiner that Feeley has notified the White House, State Department, and government of Panama about his retirement, effective March 9. The spokesperson said Feeley decided to retire for “personal reasons.”

“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 in his resignation letter, an excerpt of which was read to Reuters. “My instructors made clear that if I believed I could not do that, I would be honor bound to resign. That time has come.”

But the U.S. Embassy in Panama announced Feeley’s resignation before President Trump made derogatory and vulgar comments about Haiti and African nations.

Trump caused an uproar Thursday when he used the term “shithole” to describe African nations and asked, “Do need more Haitians?” during a bipartisan meeting with lawmakers during which they discussed a deal on the Deferred Action on Childhood Arrivals program.

Trump has denied speaking negatively about Haiti, but Senate Minority Whip Dick Durbin, D-Ill., who was in attendance, said Friday that Trump made the comments about African nations.

Feeley, a senior foreign service officer, has served as the ambassador to Panama since January 2016. He joined the State Department in 1990. Before his career as a diplomat, Feeley served as a helicopter pilot in the U.S. Marines.