During their telephone call, which also touched on the situation in North Africa and the Middle East, relations with Russia, and the crisis in Ukraine, Trump accepted Merkel's invitation to attend the upcoming G20 summit in Hamburg, Germany, in July.
"The president and chancellor also agreed on the NATO alliance's fundamental importance to the broader transatlantic relationship and its role in ensuring the peace and stability of our North Atlantic community," a White House statement said.
"In this vein, the leaders recognised that NATO must be capable of confronting 21st century threats and that our common defence requires appropriate investment in military capabilities to ensure all Allies are contributing their fair share to our collective security."
It said the pair agreed to boost cooperation to fight terror and violent extremism, as well as to stabilise conflict zones in North Africa and the Middle East.
The call was part of a series of conversations Trump was holding Saturday with various world leaders, including Japanese Prime Minister Shinzo Abe, Russian President Vladimir Putin, French President Francois Hollande and Australian Prime Minister Malcolm Turnbull.
As the European Union's leading members, both France and Germany have been rattled by Trump's virulent criticism of NATO, and his praise of Putin, whom they accuse of seeking to undermine Western unity.
Trump took office last week with US-Russia relations at new Cold War-level lows amid accusations by American intelligence agencies that the Kremlin leaked hacked Democratic Party emails as part of a pro-Trump campaign to influence November's election.
The new president -- who has raised the prospect of easing sanctions imposed against Russia after its annexation of Ukraine's Crimean Peninsula in 2014 -- has cast doubt on whether Russia meddled in the election.
"Both leaders affirmed the importance of close German-American cooperation to our countries' security and prosperity and expressed their desire to deepen already close German-American relations in the coming years," the White House statement said.
It added that Trump looked forward to hosting Merkel "soon" in Washington.