Keanu Reeves doesn’t know exactly where the idea came from, but one day — sometime around the release of “John Wick: Chapter 2,” starring Reeves, and before he started shooting “The Matrix Resurrections,” also starring Reeves — he imagined a man who couldn’t die.

“It became a series of what-ifs,” he said. “What if they were 80,000 years old? Where did this character come from? What if they came from a tribe that was being attacked by other tribes and wanted to ask the gods for a weapon, and what if a god replied, and what if that birthed a half-human, half-god child?”

From there, “it went from this simple premise and gained in complexity and continued to grow.”

For a while, the character only existed in Reeves’ head. Then he wondered: What if this immortal warrior became the basis for a comic book? An action movie? An animated series?

“And then, there’s another what-if,” he said. “What if it became a novel?”

Reeves’ ancient warrior has since become the anchor of a growing multimedia franchise.

The comic he imagined and co-wrote, BRZRKR (pronounced “berserker”), grew into a 12-issue series that has sold more than 2 million copies. A live-action film, starring and produced by Reeves, and an animated spinoff are in development at Netflix.

And now, Reeves has released his debut novel, “The Book of Elsewhere,” which he co-wrote with British science fiction author China Miéville.

Set in the world of the BRZRKR comic, “The Book of Elsewhere” is a mashup of sci-fi, fantasy, historical fiction and mythology, with a heavy dose of existentialism.

To call it a weird book doesn’t begin to capture its genre-defying, protean strangeness. It centers on Reeves’ 80,000-year-old warrior — called Unute or sometimes B — who is freakishly strong, able to rip people’s arms off and punch through their chests but has grown weary of his deathless state. It’s a pulpy, adrenaline-fueled thriller, but it’s also a moody, experimental novel about mortality, the slippery nature of time and what it means to be human.

At first, Reeves and Miéville might seem an odd pairing. Reeves is a movie star who has starred in billion-dollar action franchises like “The Matrix” and “John Wick,” as well as cult classics like the stoner time-travel comedy “Bill & Ted’s Excellent Adventure” and the surfer crime thriller “Point Break.” Miéville is a Marxist who has a doctorate in international relations from the London School of Economics. He’s known in literary circles for his heady, politically charged sci-fi and fantasy novels, among them “Kraken,” which features a squid-worshipping cult, and “Railsea,” set in a dystopian world that’s covered in railroad lines and populated by giant naked mole rats, which is an homage to “Moby-Dick” and a critique of modern capitalism.

But from another angle, the Reeves-Miéville partnership makes aesthetic, cultural and even philosophical sense. Both pose mind-bending questions about the mysteries of existence in their work and often smuggle in those ideas through action-filled plots. Reeves grew up devouring science fiction by William Gibson and Philip K. Dick, and later came to love Miéville’s short stories, which he called “a wonder.” Miéville, for his part, loves how, in movies like “The Matrix” and “Johnny Mnemonic,” Reeves was able to “combine propulsion with astonishing spectacle, with heretical philosophical provocation and investigation.”

In a recent joint interview, Reeves and Miéville each used the word “preposterous” to describe how surreal it felt to work with the other. At their first meeting in Berlin during summer 2021, Reeves told Miéville that apart from a couple of key plot points and character traits that had been established in the comic, Miéville could do what he liked with the source material.

Reeves’ openness convinced Miéville that he would be able to write something narratively interesting and deliver a book that didn’t feel like comic-book merchandise or a tie-in.

“It was important to us to approach this in a way that did something new, that did something that was very specifically literary in the sense of using the novel and using the novel form, that nonetheless was unabashedly and joyfully a BRZRKR novel and that honors the source material,” Miéville said.

As for why he wanted to write a novel, and how his literary projects intersect with his film career, Reeves had an answer that he apologetically acknowledged was “so obvious and reductive. It’s another version of storytelling, which I love.”

One of his collaborators on the comic book series, Matt Kindt, has another theory about why Reeves has invested so much in the warrior character. He thinks Reeves, who has remained a rather enigmatic figure despite his decades in the spotlight, sees aspects of himself in the warrior — a figure who is worshipped and gains a cultlike following but is lonely, treated as alien, burdened by other people’s misguided ideas about who he is.

“I could tell it was a very personal story,” Kindt said.

In some ways, he added, the story seems like an oblique response to Reeves’ iconic roles in hyperstylized action movies, as a larger-than life, invincible figure who kills again and again but can never die.

Reeves said he didn’t realize at first how much of himself he was putting into the warrior character, but he has since come to see how his metaphysical preoccupations shaped the story. “It surprised me in the creative act, what gets revealed to oneself,” he said. “Maybe the creative act is a kind of talking, you know. And so maybe I have father issues and mother issues. And maybe I think about death.”

Besides the peculiarities of the novel itself, there is also the weirdness of the fact that Reeves wrote a novel. Other movie stars have done it — see Tom Hanks, Carrie Fisher, Sean Penn, Ethan Hawke and Jim Carrey — with mixed results.

That Reeves hand-picked an award-winning novelist as his wingman, rather than quietly conscripting a ghostwriter, was a sign of his utter seriousness. They mapped out the plot together, but when it came to the actual writing, Miéville took the reins, creating an outline and delivering a draft, and making revisions based on Reeves’ suggestions.

At first, “The Book of Elsewhere” reads like a propulsive black-ops spy thriller, with scenes of carnage that bring to mind Reeves’ role as a puppy-loving assassin in “John Wick.” It opens with a scene of grotesque violence, as a secret military unit is ambushed by a suicide bomber targeting B, the warrior, who has agreed to let the U.S. military use him as a weapon in exchange for their help solving the mystery of his existence.

But pretty quickly, the novel veers into denser philosophical territory.

“It’s a big-ideas novel that’s run through with an action story,” said Ben Greenberg, who acquired and edited the novel for Random House, where it was recently released by the imprint Del Rey. “It feels very diffuse until it starts to congeal slowly. I don’t think people would be expecting that from a Keanu Reeves novel.”

“The Book of Elsewhere” is punctuated with dreamy, second-person interludes from B’s lonely eons upon the earth, as he observes the rise and fall of civilizations, technologies, species, religions, languages and ideologies. There’s an extended cameo from Sigmund Freud, who tries to treat the warrior’s incurable melancholy. B reflects on meeting Karl Marx and playwright Samuel Beckett, who once cast B in and absurdist play. There’s a central plot element that involves a magical, immortal deer-pig — specifically, a wild, tusked Indonesian pig called a babirusa — who has been hunting B for 78,000 years, and becomes both his nemesis and the closest thing he has to family.

Reeves has other ideas for new works based on the character, including, possibly, an epic poem.

“Show business looks at it like, what else can we do, but I come at it from the artist’s side, like what else can we make,” Reeves said. “From the very beginning I was hoping that other creators and artists could play, as China said, with the toys.”

He’s not sure yet how the version of the character that Miéville developed in the novel will influence the comic and other projects going forward. But he’s fairly certain it will surprise him.

“That’s to be revealed to me,” Reeves said. “There’s a lot to think about, what it can be and how it will affect the canon, as I go back and play with my own toys.”