The US ambassador to Panama has resigned, saying that he no longer felt able to serve President Donald Trump.

John Feeley, 56, a career diplomat and former Marine Corps helicopter pilot, announced his resignation in a letter to the state department.

"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," he wrote, in a letter obtained by 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."

Mr Feeley becomes the first ambassador to resign over concerns about Mr Trump's leadership.

His resignation was made public hours after Mr Trump's comments on "s-------" nations were made public, but a senior state department official told The Telegraph that Mr Feeley's decision was made before the remarks.

“Ambassador Feeley informed leadership of his decision on December 27, 2017," the state department said.

The spokesman added that the deputy chief of mission, Roxanne Cabral, will assume leadership of the diplomatic mission until a new ambassador arrives.

The state department said 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."