Donald Trump's comments about America's Europan allies have prompted the US ambassador to Estonia to resign.

James D Melville Jr, a career diplomat who serves as the US ambassador to the eastern European country, told friends and family in a private Facebook post that he was cutting his 33 year career as a senior foreign service member short after the president attacked NATO and said that European Union (EU) allies are taking advantage of the US.

“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 honourable 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,” Mr Melville wrote in the post, which was acquired by Foreign Policy magazine.

He added: “For the President to say the EU was ‘set up to take advantage of the United States, to attack our piggy bank,’ or that ‘NATO is as bad as NAFTA’ is not only factually wrong, but proves to me that it’s time to go.”

Who might replace Mr Melville when he officially leaves his post July 29 is unclear.

The resignation comes as a pivotal NATO summit looms, where European allies are concerned that Mr Trump will further isolate the US from historic allies through disputes over trade, defence spending, and America’s decision to pull out of the Iran nuclear agreement.

European leaders have expressed concern that Mr Trump is intent on disrupting western unity.

James Melville announced he was going to resign to friends and family via Facebook (US Embassy Tallinn)

However, the president of the European Council, Donald Tusk, said recently that it would be a mistake to dismiss the US president as “stupid”.

Recent reports about interactions between the US president and his international counterparts would indicate that Mr Trump has actively tried to disrupt the EU and has expressed hatred for German Chancellor Angela Merkel “because that woman embodies everything that I hate”.

Mr Trump also reportedly urged French President Emmanuel Macron to pull his country from the EU, telling him during an April visit at the White House that he would negotiate a more favourable bilateral trade agreement between the two countries if he did.

These products may become more costly in the trade war Show all 9 1 /9 These products may become more costly in the trade war These products may become more costly in the trade war Orange Juice, which Florida is known for, may soon be subject to import tariffs Getty Images These products may become more costly in the trade war The EU lists 'footwear with outer soles of rubber or of plastics and uppers of plastics' amongst the goods that may soon be subject to import tariffs Getty Images These products may become more costly in the trade war Cosmetic products, such as US brands Maybelline, MAC and Avon, may soon be subject to import tariffs Getty Images for Rebekka Ruetz These products may become more costly in the trade war Jeans, the all-American trousers, are on the EU's list of goods that may be subject to import tariffs Getty Images These products may become more costly in the trade war Bourbon whiskey is on the EU's list of over 100 US products that may be subject to import tariffs Getty These products may become more costly in the trade war US peanut butter products are on the EU's list of goods that may soon be subject to tariffs Getty Images These products may become more costly in the trade war US motorcycles, such as the Harley-Davidson, may soon be subject to import tariffs Getty Images These products may become more costly in the trade war Cranberry products, a major US crop export, may soon become more expensive Getty Images These products may become more costly in the trade war All tobacco products are on the EU's list of US goods that may be subject to import tarifs AFP/Getty Images

To put pressure on American allies to do as he wants, Mr Trump has been flirting with international trade wars for months, and has imposed increased tariffs on steel and aluminium imports on some of America’s historically close allies.

In response, Canada, Mexico, and the EU have imposed duties of their own. Those tariffs impact a range of products, including whiskey, nails, yachts and motorcycles.

Shortly after the new tariffs, motorcycle manufacturer Harley Davidson announced that it would move its manufacturing plant to Thailand to avoid the tariffs on bikes sold in the EU.

Mr Trump, in return, threatened the company, saying during a trip in Wisconsin this week: “Harley Davidson, please build those beautiful motorcycles in the USA, please, OK? Don’t get cute with us. Don’t get cute. They don’t realize their taxes are coming way down, they don’t realize that yet”.