The U.S. ambassador to Panama is resigning, in a decision that was made prior to President Trump's "sh*thole country" comments.

John Feeley, a career diplomat who used to be a helicopter pilot in the Marine Corps, communicated his resignation to the State Department on Dec. 27, indicating he felt he could no longer serve, according to Reuters.

"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 his resignation 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."

Get Breaking News Delivered to Your Inbox

State Department spokeswoman Heather Nauert confirmed his impending departure, which will take place in March. She pointed out that he "did not resign over alleged comments about the visa lottery system."

John Feeley, @USEmbPAN Ambassador, sent a letter of resignation on December 27 informing the administration of his decision to retire for personal reasons as of March 9 of this year. Ambassador Feeley did not resign over alleged comments about the visa lottery system. — Heather Nauert (@statedeptspox) January 12, 2018

We thank @USEmbPAN Ambassador Feeley for his distinguished career of service to the @StateDept on behalf of the American people. — Heather Nauert (@statedeptspox) January 12, 2018

Steve Goldstein, the State Department's undersecretary for public diplomacy, said that "everyone has a line they will not cross," referencing Feeley's resignation.

"If the ambassador feels he can no longer serve, then he has made the right decision for himself," Goldstein said. "And we will bring in a new ambassador to Panama. Everyone has a line they will not cross..."

The resignation comes as diplomats across the globe are trying to handle the fallout from Mr. Trump's comments to lawmakers Thursday, when the president seemed to deride "sh*thole countries." Top U.S. officials in Haiti and Botswana have been summoned to explain the president's remarks.

"Why are we having all these people from sh*thole countries come here?" the president said in the Thursday afternoon Oval Office meeting with a handful of members of the House and Senate. "We should bring in more people from places like Norway," he added. Norway's prime minister visited the White House Wednesday. The Trump administration recently decided to soon end Temporary Protected Status for citizens of countries like Haiti and El Salvador, who came to the U.S. to escape natural disasters.

The State Department has issued guidance to diplomats as to how to handle the remarks. Goldstein said the department is telling diplomats to primarily listen and see how the nation feels. The U.S. commitment to the nation has not changed, is the message. U.S. diplomats have an obligation to represent the U.S. throughout the world, Goldstein noted.

"Will they have to work extra hard today? Yes, they will," he said.

CBS News' Kylie Atwood contributed to this report.