Goldstein told reporters that he was aware of Feeley's planned departure in advance, even before Trump's alleged use of the term.
"My instructors made clear that if I believed I could not do that, I would be honor bound to resign", Feeley continued. "That time has come", he added.
Reached by TWS, the State Department declined to comment on whether the excerpt was genuine.
'Dreamers' get reprieve as judge blocks Trump's DACA plan
On the other side, the White House risks angering Trump's base if it grants a path to citizenship for the DREAMers. Democratic Senator Dick Durbin has been leading that group, along with Republican Senator Lindsey Graham .
So widespread was the disinformation, that the State Department issued a statement correcting the record.
"Everyone has a line that they don't want to cross and we respect that", Goldstein said. According to the letter, the U.S. ambassador leaves his position with a feeling of vast gratitude to the foreign government and the citizens of Panama who shared a relationship of mutual friendship, respect and teamwork.
Various press reports in Panama said Feeleys decision to leave the post was made before reports of Trumps offensive remarks.
News of Feeley's resignation comes a day after Trump's comments about immigration and developing countries, where Trump questioned why the US would accept more immigrants from Haiti and "shithole countries" in Africa.
Feeley was also a vocal supporter of former U.S. Ambassador to the Dominican Republic Wally Brewster, whose appointment generated a backlash because Brewster is married to a man.