BERLIN -- European Union nations reacted with surprise and defiance Monday to comments made by President-elect Donald Trump, who said in an interview that NATO was “obsolete” and hinted that more member states would leave the 28-nation EU.

German Foreign Minister Frank-Walter Steinmeier, speaking ahead of an EU foreign ministers meeting, said Mr. Trump’s view on NATO and criticism that allied members weren’t paying their fair share has “caused astonishment.”

His French counterpart Jean-Marc Ayrault added that the best response to such an interview was simple - Europeans uniting together.

Even though Mr. Trump had made similar comments during his tempestuous election campaign, a repeat of the same points still hit Europe hard and still came as a bit of a surprise, since his choice for defense secretary, General James Mattis, stressed his support for the alliance in his U.S. congressional confirmation hearings last week.

Get Breaking News Delivered to Your Inbox

Steinmeier said Mr. Trump’s views in an interview with German daily Bild and The Times of London “are contradictory to statement of” Mattis.

Even in Mr. Trump’s own comments to the Times of London disparaging NATO as obsolete and unfair, he added that the alliance was “very important” to him.

A senior Russian official, meanwhile, suggested Mr. Trump’s stance on NATO was the same one the Kremlin has espoused for some time, agreeing the trans-Atlantic alliance was “obsolete.”

Beyond NATO, Mr. Trump indicated he was indifferent to whether the EU stays together or not, a sharp break from the Obama administration, which encouraged Great Britain to remain in the EU last year before the U.K. voted in June to leave.

Ayrault said “the best way to defend Europe -- and it is at Trump’s invitation -- is to stay united, together as a bloc.”

Britain decided to leave the EU in a vote in June. In the interview, Mr. Trump said “I believe others will leave ... I do think keeping it together is not gonna be as easy as a lot of people think.”

Trump predicted that Brexit -- the British exit from the EU -- would “end up being a great thing” and said he was already looking forward to bilateral relations with Britain.

British Foreign Secretary Boris Johnson said it’s “very good news that the United States of America wants to do a good free trade deal with us and wants to do it very fast.”

Mr. Trump was less kind to German industry officials, saying their car manufacturers including BMW could face tariffs of up to 35 percent if they set up plants in Mexico instead of in the U.S. and try to export cars to the U.S. from there.

Such tariffs would make “the American auto industry worse, weaker and more expensive,” Sigmar Gabriel, Germany’s economy minister, told Bild.

Gabriel suggested Europeans exhibit more self confidence in dealing with Mr. Trump.

“We’re not weak and inferior,” he noted.

Responding to Mr. Trump’s complaint that German automakers don’t behave fairly because a lot of German cars are seen in the U.S. but few American cars are bought in Germany, Gabriel suggested the solution might be that “the U.S. needs to build better cars.”