President Trump has gone on the attack again over Germany's huge trade surplus.

At a meeting with senior European Union officials in Brussels on Thursday, Trump said Germany was "very bad on trade," according to the president's top economic adviser Gary Cohn.

"He said they're very bad on trade but he doesn't have a problem with Germany," Cohn told reporters who traveled with Trump to a G7 summit in Sicily, Italy, on Friday.

A spokeswoman for Germany's economy ministry declined to comment on Trump's remarks, but they won't help his tricky relationship with Europe's leading power.

German media first reported that Trump had repeated previous criticism of the country over trade at a meeting with European Commission President Jean-Claude Juncker.

Citing sources who participated in Thursday's meeting, German magazine Der Spiegel quoted Trump as saying: "The Germans are bad, very bad. Look at the millions of cars they're selling in the U.S. We will stop that."

A newspaper -- the Sueddeutsche Zeitung -- reported that Trump made clear that reducing the U.S. trade deficit was a top priority.

Germany's global exports were worth $270 billion more than its imports in 2016, the largest surplus on record. The U.S., by contrast, had a global trade deficit of more than $500 billion.

Trump believes that is evidence America is losing the global economic game. Its deficit in goods trade with Germany alone was worth $65 billion in 2016.

Related: Germany's export motor is rolling

Trump has taken aim at German carmakers before. In an interview in January, he said Germany's BMW (BMWYY) should reconsider building a plant in Mexico, where it plans to start assembling the BMW 3 Series sedan in 2019.

"I would tell them, don't waste their time and money -- unless they want to sell to other countries," he said. "But I would tell BMW if they think they're gonna build a plant in Mexico and sell cars into the U.S. without a 35% tax, it's not gonna happen."

Related: Merkel to Trump adviser: We're not manipulating the euro

Another Trump adviser, Peter Navarro, previously accused Germany of using a "grossly undervalued" euro to hurt the U.S. economy.

Germany has pointed out that the European Central Bank manages monetary policy independently for all countries that use the euro. It has also touted investments made by German companies in the U.S., and their role as major job creators.

Speaking before she met Trump in March, German Chancellor Angela Merkel said: "There are about 750,000 jobs created by German companies in the USA. If you multiply that by two or three, you can see that over 1-2 million jobs depend on German companies."

BMW's largest assembly plant is in Spartanburg, South Carolina, while Volkswagen (VLKAY) has a big factory in Chattanooga, Tennessee.

Merkel is attending the G7 summit in Sicily but a one on one meeting with Trump is not scheduled.

Related: Trump pulls his punches on Germany and China

Germany argues that the size of its trade surplus is largely a consequence of factors beyond its control, such as the price of oil and the value of the euro, as well as the ability of its companies to compete on the world stage.

But it is sensitive to criticism about the surplus, which is sometimes raised by European officials too.

Merkel's government says it is taking action to boost domestic demand and imports by encouraging investment in Germany and raising wages and pensions.

"Much has already been achieved here. These steps can also contribute to a sustained reduction in the trade surplus," the economy ministry spokeswoman said.

-- Nadine Schmidt and Kara Manry contributed to this article