Just days before Donald Trump won the election, Elon Musk expressed a common sentiment in Silicon Valley: "He is not the right guy."

But it turns out Trump may be the right guy for Musk and his businesses.

In recent weeks, the Tesla (TSLA) and SpaceX CEO has been named to Trump's team of business advisers and visited Trump Tower twice. The first time he was part of a big meeting with tech CEOs; the second came earlier this month for a private meeting with Trump's top aides.

The blossoming relationship between Musk and Trump's camp has caught the attention of Tesla investors.

"Elon Musk has an important line of communication to Donald Trump through his role as a strategic advisor to the President-elect," Adam Jonas, an analyst with Morgan Stanley, wrote in an investor note Thursday.

"We believe this level of coordination with the new administration could actually evolve into greater strategic value than with the prior administration," Jonas added.

While the investor note was specifically about Tesla, it could also apply to SpaceX, which has lucrative government contracts for space shipments.

That Musk could profit more under Trump than President Obama may come as a shock to most. At first blush, Musk and Trump couldn't seem more at odds in their priorities.

One has taken an adversarial stance on immigration and climate change; the other came to the U.S. from South Africa (by way of Canada) and built a roughly $40 billion business to help the environment.

Related: Trump sits down with top Silicon Valley execs

But the two men may be drawn together by a mutual friend (billionaire tech investor and Trump adviser Peter Thiel) and have more in common than some would assume.

"Elon and Trump share two very important things in common: strengthening U.S. manufacturing and job growth," Jason Calacanis, a tech investor and friend of Musk's, told CNNTech.

Trump has pressured companies like Apple (AAPL) to "build their damn computers and things in this country." Musk already does. SpaceX builds rockets in Hawthorne, California. Tesla makes its cars in a factory in Fremont, California, and opened a battery factory in Nevada.

"The Gigafactory, Tesla and Solar City have created a massive number of high-quality jobs while building the most advanced manufacturing on the planet, which is exactly what Trump was elected to do," Calacanis says.

Musk echoed this point during a Q&A session with analysts this month at the Gigafactory.

"The President-elect has a strong emphasis on U.S. manufacturing and so do we. We are building the biggest factory in the world right here, creating U.S. jobs," Musk is quoted as saying at the event, according to an earlier investor note from Morgan Stanley's Jonas.

Musk also said he expects "we may see some surprising things from the next administration," including the possibility that Trump is actually "positive" on renewable energy, despite his rhetoric on climate change.

Reps for Tesla did not immediately respond to a request for comment. James Gleeson, a spokesman for SpaceX, declined to comment.

Related: How the private sector can fight climate change, with or without Trump

Beyond the shared emphasis on U.S. manufacturing, Musk also shares common traits with Trump.

One former Tesla employee compared Musk to Trump in that both are hyper aware of their public image and effectively do their own public relations through Twitter.

Peter Thiel was asked in a recent interview if Musk and Trump are similar. "I'm going to get in trouble, but they are, actually."

"They're both grandmaster-level salespeople and these very much larger-than-life figures," said Thiel, who cofounded PayPal (PYPL) with Musk and serves on Trump's transition team.

Some take issue with the comparison, however.

"At his core, Trump is a consummate salesman working in real estate, which is very, very different than what Elon is: a visionary engineer who is reinventing manufacturing, transportation and space travel," says Calacanis.