Elon Musk's relationship with Google cofounder Larry Page is complicated, to say the least.

On the one hand, the two influential tech CEOs are close friends and business associates; on the other hand, Musk is genuinely worried that Page might just lead to the destruction of humanity as we know it.

"I'm really worried about this," Musk is quoted as saying in Elon Musk, a new authorized biography of the CEO of Tesla and SpaceX.

"This," according to the book, refers to the possibility that Page would develop artificially-intelligent robots that could turn evil and have the ability to annihilate the human race.

Page may be well-meaning, but as Musk says, "He could produce something evil by accident."

Google has acquired more than half a dozen robotics companies to date, but the company's ultimate goal for robots is unclear. Andy Rubin, the executive in charge of the (maybe not killer) robot effort, left Google late last year.

Both Page and Musk have publicly discussed their views on artificial intelligence — though not directed at each other.

"We do have lots of proof points that one can create intelligent things in the world because– all of us around," Page said in an interview last year. "Therefore, you should presume that someday, we will be able to make machines that can reason, think and do things better than we can."

A few months after that, Musk told an interviewer that he believes "something seriously dangerous" may come about from AI in the next 5-10 years. "Please note that I am normally super pro technology and have never raised this issue until recent months. This is not a case of crying wolf about something I don't understand."

Google CEO Larry Page, foreground, and Sundar Pichai, senior vice president of Android, Chrome and Apps, left, walk along the demo floor at Google I/O 2014 in San Francisco, Wednesday, June 25, 2014. Image: Jeff Chiu/Associated Press

A budding bromance

Musk and Page had very different upbringings — the former had a difficult childhood in South Africa during apartheid; the latter grew up in Michigan — but they are similar in age, disposition and the desire to pursue projects that sound impossible or downright crazy.

Each week, Musk bounces between the SpaceX and Tesla offices in Los Angeles and San Francisco, respectively. When in San Francisco, Musk crashes at the homes of friends, including Page.

"He's kind of homeless, which I think is sort of funny," Page is quoted as saying in the biography. "He'll email and say,'I don't know where to stay tonight. Can I come over?' I haven't given him a key or anything yet."

Sometimes Musk will meet with Page and Google cofounder Sergey Brin at a "secret apartment" owned by the Internet giant to talk through ridiculous ideas.

"It's kind of our recreation, I guess," Page says in the book. "It's fun for the three of us to talk about kind of crazy things, and we find stuff that eventually turns out to be real. We go through hundreds or thousands of possible things before arriving at the ones that are most promising."

One such idea, according to a friend who once attended the brainstorm: "building a commuter plane that was always circling the Earth, and you'd hop up to it and get places incredibly fast."

Friends with benefits

The close friendship has yielded business benefits for Musk's risky businesses.

Both Page and Brin personally invested in Tesla before the car company went public. Earlier this year, Google joined with Fidelity to invest $1 billion in SpaceX, Musk's private aerospace manufacturing business.

At one point, Musk even turned to Page to bailout his company.

In April, 2013, with Tesla on the cusp of failure, Musk reached out to Page about acquiring Tesla and keeping him in charge until it could put out a car. According to the book, the pair had a handshake agreement on a deal that would have cost Google about $11 billion in total — though it's worth noting Tesla has a market cap of $30 billion today.

The next month, Tesla turned its its first profit. The stock surged and Musk backed out of the deal. The rest is history.

It's good to have friends in high places — as long as they don't unintentionally ruin civilization.