President Donald Trump told CNBC on Wednesday that Elon Musk is one of the world's "great geniuses," he likened the CEO of Tesla and SpaceX to Thomas Edison.

Musk is "one of our great geniuses, and we have to protect our genius," Trump said in an interview with "Squawk Box" co-host Joe Kernen from the World Economic Forum in Davos, Switzerland.

"You know, we have to protect Thomas Edison and we have to protect all of these people that came up with originally the light bulb and the wheel and all of these things. And he's one of our very smart people and we want to cherish those people," the president said.

In a 2008 interview, Musk said Edison and Nikola Tesla, for whom he named his electric auto company, were both role models, but he preferred Edison. Tesla, the scientist, was a rival of Edison.

Trump's comments on Musk come as shares of Tesla have surged recently, more than doubling since late September, and hitting all-time high after all-time high. The stock market value of Tesla set to reach $100 billion. Its market capitalization is greater than those of General Motors and Ford combined.

Tesla stock has been on a tear after the electric car maker announced a surprise profit in its third-quarter earnings report in October. Back then, the stock was just more than $250 per share.

Musk's now-infamous "funding secured," Aug. 7, 2018, tweet sent the stock soaring, but it also marked the beginning of a chaotic ride for the company and Musk. In the 16 months that followed, Tesla stock bottomed at a three-year low just under $177 per share in June before boomeranging back up.

Trump recalled those rough times. "You go back a year and they were talking about the end of the company. And now all of a sudden they're talking about these great things."

In CNBC's interview on Wednesday, the president also marveled at what Musk's commercial company SpaceX has accomplished with rockets that land themselves.

"I spoke to him very recently, and he's also doing the rockets. He likes rockets. And he does good at rockets, too, by the way. I never saw where the engines come down with no wings, no anything, and they're landing. I said I've never seen that before," Trump said.