The US Ambassador to Estonia, James Melville (pictured), is resigning over Donald Trump’s rants about the European Union and its members.

Melville, a career diplomat for 33 years, wrote to friends on Facebook that Trump’s behavior and comments accelerated his decision to retire. He cited Trump comments such as the European Union was “set up to take advantage of the United States [and] to attack our piggy bank” and “NATO is as bad as NAFTA”:

A Foreign Service Officer’s DNA is programmed to support policy and we’re schooled right from the start, that if there ever comes a point where one can no longer do so, particularly if one is in a position of leadership, the honorable course is to resign.

Having served under six presidents and 11 secretaries of state, I never really thought it would reach that point for me.

In recent days, diplomats have told the media of a series of provocative Trump statements at the G7 summit earlier this month, including his dislike of German Chancellor Angela Merkel and his encouragement of French President Emmanuel Macron to leave the EU and forge a bilateral trade deal with the US.

In less than two weeks, Trump will meet other leaders at a NATO summit and then head to Finland to confer with Russian President Vladimir Putin.

Melville said he believed in US support for the European Union and NATO to his “marrow”:

I leave willingly and with deep gratitude for being able to serve my nation with integrity for many years, and with great confidence that America, which is and has always been, great, will someday return to being right.