President Donald Trump told CNBC that Apple's recent investment announcement helped inspire his appearance at the World Economic Forum this week in Davos, Switzerland.

In an interview that aired on "Power Lunch," Trump said that he was "honored" by an investment announcement by Apple CEO Tim Cook.

"You remember my campaign: I said I won't consider this great until Apple starts coming in and really investing big money, doing the plants," Trump said. "They're gonna do a lot."

Earlier this month, Apple said it planned to contribute $350 billion to the U.S. economy over the next five years, by: Continuing its yearly payments of $55 billion to American companies, investing $30 billion in capital expenditures, paying $38 billion in taxes, pouring $5 billion into manufacturing, building a new tech-support campus and adding 20,000 jobs.

At that time, Trump said he called Cook and thanked him for the announcement (which did not explicitly mention a new plant.)

Here's the full quote Trump gave CNBC in Davos on Wednesday.

"When I decided to come to Davos, I didn't think in terms of elitist or globalist. I thought in terms of, 'Lots people that want to invest lots of money and they're all coming back to the United States — they're coming back to America.' And I thought of it much more in those terms. After I said that I was going, there were massive stories about 'the elite' and 'the globalists' and the planes flying in and everything else. It's not about that. It's about coming to America, investing in money, creating jobs, companies coming in. We're setting records — every week, every day — we're setting records. You see what's going on: Apple now with $350 billion dollars — most people thought they meant $350 million, which would build a nice plant. But I spoke with Tim Cook and I was very honored by — you remember my campaign — I said I won't consider this great until Apple starts coming in and really investing big money, doing the plants. They're gonna do a lot."

As the world's most valuable company, Apple was already expected to be a huge economic driver in the U.S. over the next five years. But the move certainly softens the tough relationship that developed between Apple and Trump on the campaign trail.

Less than two years ago, Trump said his supporters should boycott Apple, because of the company's stance on encryption in a terrorism investigation. Later in 2016, then President-elect Trump publicly called out Apple's reliance on China in The New York Times.

— Reporting by CNBC's Joe Kernan