President Donald Trump met on Wednesday with North Atlantic Treaty Organization (NATO) Secretary General Jens Stoltenberg at the White House. Past meetings between American presidents and NATO leaders have seldom seen such a contentious lead-in.

Despite words of praise for NATO at their joint news conference, Mr. Trump has repeatedly questioned NATO’s purpose and efficacy, calling it “obsolete,” while charging that the United States is saddled with paying an unfair share as a member. It was one of Mr. Trump’s most consistent messages in the months preceding his election. But if his views are strongly held, they’re relatively newly formed. The only mention of NATO on his Twitter feed before he hit the campaign trail was a single 2012 tweet lamenting that Israel, not a NATO member, was excluded from a NATO gathering in Chicago.

Here’s a comprehensive look at Mr. Trump’s past comments about the military alliance.

Get Breaking News Delivered to Your Inbox

March 21, 2016 -- then-candidate Trump meets with the Washington Post’s editorial board. He describes NATO as an anachronism from a more affluent American time:

“NATO was set up at a different time. NATO was set up when we were a richer country. We’re not a rich country anymore. We’re borrowing, we’re borrowing all of this money...NATO is costing us a fortune and yes, we’re protecting Europe with NATO but we’re spending a lot of money. Number one, I think the distribution of costs has to be changed. I think NATO as a concept is good, but it is not as good as it was when it first evolved.”

March 21, 2016 -- Trump participates in a CNN town hall later the same day. He’s asked directly about NATO by host Wolf Blitzer, and again cites the costs to the U.S.

CNN’s Blitzer: Do you think the United States needs to rethink U.S. involvement in NATO? Trump: Yes, because it’s costing us too much money. And frankly they have to put up more money. They’re going to have to put some up also. We’re playing disproportionately. It’s too much. And frankly it’s a different world than it was when we originally conceived of the idea. And everybody got together.

March 26, 2016 -- Trump is interviewed by the New York Times’ Maggie Haberman and David Sanger. The Times reported that he wished to refocus NATO on counterterrorism:

“Mr. Trump struck similar themes when he discussed the future of NATO, which he called “unfair, economically, to us,” and said he was open to an alternative organization focused on counterterrorism.”

March 27, 2016 -- Trump sends one of his earliest campaign-season tweets about NATO:

My statement on NATO being obsolete and disproportionately too expensive (and unfair) for the U.S. are now, finally, receiving plaudits! — Donald J. Trump (@realDonaldTrump) March 27, 2016

April 2, 2016 -- Trump doubles down on NATO criticism at a Racine, WI campaign rally, but admits he’s only a recent study on the NATO topic:

“I said here’s the problem with NATO: it’s obsolete. Big statement to make when you don’t know that much about it, but I learn quickly.”

April 8, 2016 -- “Looks like I was right about NATO,” Trump tweets, linking to a Foreign Policy article about other Republican senators arguing over NATO allies’ laggardly defense spending:

Looks like I was right about NATO. I had no doubt. https://t.co/x6Ne3sjAWz — Donald J. Trump (@realDonaldTrump) April 8, 2016

June 6, 2016 -- Trump repeats his charge that the military alliance is obsolete, and points out that they are appointing a new intelligence chief, insinuating that his criticism prompted the move:

See, when I said NATO was obsolete because of no terrorism protection, they made the change without giving me credit.https://t.co/sRCF1H3rjg — Donald J. Trump (@realDonaldTrump) June 6, 2016

July 17, 2016 -- Trump and running mate Mike Pence are interviewed by CBS News’ Lesley Stahl on 60 Minutes; she asked Trump to explain how he would tackle the fight against ISIS as president. NATO was invoked:

“We’re going to have surrounding states and, very importantly, get NATO involved because we support NATO far more than we should, frankly, because you have a lot of countries that aren’t doing what they’re supposed to be doing.” Mike Pence says U.S. supports NATO, but wants... 06:38

July 20, 2016 -- Trump is, again, interviewed by the New York Times’ Maggie Haberman and David Sanger at the Republican National Convention:

“If we cannot be properly reimbursed for the tremendous cost of our military protecting other countries, and in many cases the countries I’m talking about are extremely rich...we have many NATO members that aren’t paying their bills.”

July 20, 2016 -- Trump softens his rhetoric, somewhat, on NATO; in a tweet, he does not refer to the military alliance “obsolete,” instead calling for fellow members to “pay their bills”:

Wow, NATO's top commander just announced that he agrees with me that alliance members must PAY THEIR BILLS. This is a general I will like! — Donald J. Trump (@realDonaldTrump) July 30, 2016

January 15, 2017 -- in a joint interview, post-election, pre-inauguration, with the Times of London and Germany’s Bild, Trump reflects on his “obsolete” comment, but insists he was both correct and vindicated:

“I took such heat, when I said NATO was obsolete. It’s obsolete because it wasn’t taking care of terror. I took a lot of heat for two days. And then they started saying Trump is right.”

February 6, 2017 -- Trump, as president and commander-in-chief, addresses military officials at MacDill Air Force Base in Tampa, Fl. after a visit with United States Central Command. He says of NATO: