German President Frank-Walter Steinmeier addresses the opening speech of the 56th Munich Security Conference in Munich, southern Germany, on February 14, 2020.

"Our closest ally, the United States of America, under the current administration, rejects the very concept of the international community," he said. "'Great again' but at the expense of neighbors and partners," Steinmeier added without naming Trump but referring to his "Make America Great Again" campaign slogan.

In his opening remarks, German President Frank-Walter Steinmeier warned that the United States would put its own interests first at the expense of allies.

MUNICH — Germany's president kicked off the annual Munich Security Conference on Friday by taking a swipe at President Donald Trump's "America First" foreign policy approach.

"Thinking and acting this way hurts us all," he said.

Attending Steinmeier's speech, delivered at the 56th Munich Security Conference, were Secretary of Defense Mark Esper, Speaker of the House Nancy Pelosi, Sen. Lindsey Graham and Rep. Adam Schiff along with other representatives, making it the largest U.S. delegation to attend the forum.

Read more: Nuclear weapons and 5G among national security topics at Munich Security Conference

Steinmeier also accused Russia and China of amplifying global insecurity in pursuit of "great power" competition.

"In this scenario, the security of one is the insecurity of others," he said, adding that European leaders must create a unified policy to deal with increasing threats posed by Russia and China.

The former German foreign minister also placed emphasis on the importance of NATO, the world's most powerful military alliance, which has been frequently dressed down by Trump.

In December, Trump reiterated at the NATO leaders meeting that too many members were still not paying enough and threatened to reduce U.S. military support if allies do not increase spending.

At the meeting in London, Trump singled out German Chancellor Angela Merkel for not meeting the 2% of GDP spending goal set in the 2014 NATO summit in Wales.

Read more: What each NATO country contributes financially to the world's strongest military alliance

"So we're paying 4[%] to 4.3% when Germany's paying 1[%] to 1.2% at max 1.2% of a much smaller GDP. That's not fair," Trump said at the time.

Germany is only one of 19 NATO members that have not met the 2% GDP spending goal set at the 2014 summit.

Steinmeier said that while Germany should continue to raise its defense spending, it should not be "the be-all end-all for our security."

Correction: This article has been corrected to accurately reflect the names of the U.S. officials who were present at Steinmeier's speech.