As a candidate, Trump sparked concerns in Europe for suggesting that he could set conditions for defending members who were under attack. He questioned NATO's continued relevance.

Merkel said she was "gratified to know" how "important" Trump feels NATO is.

"I reiterated to Chancellor Merkel our strong support for NATO, as well as the need for our NATO allies to pay their fair share for the cost of defense," Trump said at a joint White House press conference following the meeting.

Trump and Merkel have held starkly different views on some issues. Trump has touted nationalism and American strength, while Merkel and Germany are seen as embodying the supporters of multinational institutions like the European Union. Trump has criticized Merkel's handling of the Syrian refugee crisis, among other issues, but he and some advisors have previously praised Germany's economy.

Trump's criticism of the alliance relates to a guideline that member countries should spend 2 percent of their gross domestic product on defense, a standard that most do not meet. Germany fell short of spending that amount in 2016, and NATO says only five of 28 members were estimated to hit that mark.

Trump said he thanked Merkel for working to increase spending toward 2 percent of GDP.

After Trump met with British Prime Minister Theresa May in January, May said the pair is "100 percent behind NATO." May said she "agreed to continue my efforts to persuade my fellow European leaders to deliver on their commitment to spend 2 percent of GDP on defense, so that the burden is more fairly shared."

Trump's predecessor President Barack Obama also expressed concerns about NATO members contributing enough.

Watch: Trade & NATO big topics today