BERLIN/WASHINGTON (Reuters) - German Chancellor Angela Merkel and U.S. President Donald Trump underscored the importance of the NATO alliance and vowed to work more closely together to combat terrorism and militancy, the two leaders said in a joint statement on Saturday.

U.S. President Donald Trump (L), joined by White House senior advisor Steve Bannon (2nd R) and Chief of Staff Reince Priebus (R), speaks by phone with Germany's Chancellor Angela Merkel in the Oval Office at the White House in Washington, U.S. January 28, 2017. REUTERS/Jonathan Ernst - RTSXSUH

Merkel and Trump spoke by telephone on Saturday about NATO, the situation in the Middle East and North Africa, their ties to Russia and the conflict in eastern Ukraine, according to a statement approved by both countries.

“The leaders recognized that NATO must be capable of confronting 21st century threats and that our common defense requires appropriate investment in military capabilities to ensure all allies are contributing their fair share to our collective security,” Merkel and Trump said in the statement.

Trump accepted Merkel’s invitation to attend a summit of G20 industrialized countries in Hamburg in July, and said he looked forward to welcoming Merkel to Washington soon. Germany is chairing the G20 group this year.

The statement made no mention of Trump’s executive order limiting immigration or his moves to cancel free trade deals, issues that have drawn criticism from German Foreign Minister Sigmar Gabriel and other German officials in recent days.

Trump also spoke with Russian President Vladimir Putin and French President Francois Hollande, whose office said he warned the U.S. leader about the economic and political consequences of protectionism.

The joint German-U.S. statement, by contrast, highlighted areas of common interest and stressed the importance of ties between the United States and Europe’s largest economy.

The language on NATO came after Trump called the alliance “obsolete”, but it highlighted the need for reforms and updates.

Trump has repeatedly criticized NATO members such as Germany that do not spend 2 percent of gross domestic product (GDP) on their militaries.

Merkel has said Germany will work to increase its defense spending - now at 1.19 percent of GDP - but also warned that it would take time to achieve the goal.

Trump has also said Merkel made a “catastrophic mistake” by allowing more than a million refugees, mostly Muslims fleeing war in the Middle East, to come to Germany.

For her part, the German leader, who is seeking a fourth term in office, has refrained from being too critical of Trump, although she pointedly offered to work closely with him on the basis of “democracy, freedom, respect for the law and for human dignity, regardless of origin, skin color, religion, gender, sexual orientation or political inclination”.

Earlier this week she said that openness, not populism, polarization or isolation, was the answer to the world’s challenges of globalization and digitalization.