The U.S. ambassador to Panama abruptly resigned from his diplomatic post on Friday, stating in his resignation letter that he can no longer serve a country with Donald Trump as president, Reuters reported.

The Department of State confirmed the departure of John D. Feeley, a career diplomat and former Navy helicopter pilot, stating that the ambassador decided to retire for personal reasons.

Feeley's departure comes a day after Trump reportedly used offensive language during a meeting in the Oval Office with lawmakers, when they proposed restoring protections for immigrants from Haiti, El Salvador and African countries as part of a bipartisan immigration deal.

"Why are we having all these people from shithole countries come here?" Trump asked, according to Washington Post sources, referring foreigners from African countries and Haiti.

President Trump on Friday denied that he used such terminology.

Reuters reported that Feeley's letter of resignation stated: "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.

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

Various press reports in Panama said Feeley's decision to leave the post was made before reports of Trump's offensive remarks.