Tom Cruise will save the world from aliens — not on the big screen but in real life.

His day job as an actor pales next to the billion-year contract of service he signed with the Church of Scientology, according to a bombshell new book, “Going Clear: Scientology, Hollywood & The Prison of Belief.” New Yorker writer Lawrence Wright details Cruise’s demigod status within the church, as well as the group’s ultimate purpose — protect humanity from aliens living in our bodies, who are bent on destroying us and ultimately the planet.

Cruise was introduced to the religion when he was 23 years old by his then-girlfriend, actress Mimi Rogers. Seven years his senior, Rogers was an avowed member of Scientology; they married in 1987. Cruise was quickly intrigued, but he kept his initial participation low-profile. He began undergoing “auditing” — a process in which church members are queried about every aspect of their lives — under his given name, Thomas Mapother IV.

It took several years for church leaders to realize that for all of their celebrity acolytes — including John Travolta, Priscilla Presley, Kirstie Alley, Kelly Preston and Sonny Bono — they had a true superstar at their disposal.

Cruise would later come to believe that in the hierarchy of Scientology, he was No. 3, behind only the founder, the late L. Ron Hubbard (known as LRH) and No. 2 David Miscavige, who goes by COB, for Chairman of the Board of the Religious Technology Center.

Or, as Cruise would later scold a Scientologist girlfriend who had suffered through severe menstrual pain during dinner with Miscavige and therefore shown disrespect to both men: “You don’t get it. It goes like this. First, there’s LRH.” Cruise had raised his hand in the air and lowered it as he counted. “Then, there’s COB. Then there’s me.”

That girlfriend, Naz Boniadi, was auditioned as a possible wife before Katie Holmes. After that incident, she never saw Cruise again. According to the book, her punishment for failure would include the cleaning of public toilets using only a toothbrush (Scientology officials have denied this).

By his own account, Cruise was “a functional illiterate” by the time he graduated high school. He suffered from dyslexia and was also the product of a troubled, chaotic upbringing. He was born in upstate Syracuse but spent much of his childhood in Canada. He was just 12 years old when his mother woke up early one morning, grabbed Cruise and his three sisters and fled from Cruise’s abusive father. They felt, he said, “like fugitives.”

They relocated to Glen Ridge, NJ, and after eking his way through high school, Cruise pursued his two main interests: spirituality and acting. Raised Catholic, he seriously considered becoming a priest, but as his nascent career took off he lost interest. Two roles would put him over the top: the lead role in 1983’s “Risky Business,” and the iconic part that would turn him into a global superstar: that of Maverick in “Top Gun.” The movie grossed nearly $350 million worldwide.

It was church leader Miscavige who took it upon himself to ensure that Cruise became a true believer, a stalwart who could spread the message.

The sickly son of a salesman, Miscavige had grown up in a New Jersey suburb, and it was his father, Ron, who sought the help of Scientology in treating David’s asthma. The treatments failed, but David was an eager student, and by the age of 12 was known as “the Wonder Kid.”

Miscavige dropped out of high school in his sophomore year. According to the book, he was “sickened by the declining moral situation in schools illustrated by rampant drug use,” and devoted himself to the church. His devotion did not go unnoticed, and he was tapped by L. Ron Hubbard himself as heir to church leadership. (Hubbard died in 1986.)

Miscavige’s goal was mainstreaming Scientology, and Cruise was his best chance.

Cruise gave Miscavige an opening in late 1989, when Tom became obsessed with a young, relatively unknown actress named Nicole Kidman, whom he’d just cast in his next film, “Days of Thunder.” There was just one thing: Cruise was still married to Mimi Rogers, and he needed to get rid of her, quickly and cleanly.

Miscavige made it happen. Rogers was told that she had no say in the fate of her marriage, because this was bigger than her and Tom. This was about the church, which needed Cruise as its salvation.

“I told her this was the right thing to do for Tom,” said Marty Rathbun, the church’s former inspector general of the Religious Technology Center, in “Going Clear.” “Because he was going to do lots of good for Scientology.”

And that, he said, “was the end of Mimi Rogers.”

Though Miscavige began soliciting Kidman’s favor, he was secretly working up a file on her. He was convinced she was a “Potential Trouble Source”: Kidman identified as a Catholic and her father was a prominent psychologist. Catholicism was one thing, but the Scientology Church’s beliefs when it comes to psychology and psychiatry — namely, that both are nefarious practices meant to control the individual through drugs and brainwashing — made Kidman an alarming presence.

He could do nothing, however, to tip off Cruise. So Miscavige began turning the grounds of the LA Church of Scientology Celebrity Centre into a movie set where they could act out their love scenes.

Miscavige had lower-tier Scientologists — most of whom averaged $50 a week in pay — tend to a private bungalow for Kidman and Cruise. A rose garden was planted, and when that wasn’t enough — the two of them daydreamed about romping through a field lush with wildflowers — Miscavige got to work on that, too, ordering its cultivation in the California desert. He was furious when that failed.

Though Kidman really had little interest in Scientology, she went along, and she had a lot of catching up to do. By now, Cruise was “OT III,” or “Operating Thetan III” — thetans, in church doctrine, being the alien life forms that inhabit human beings. Scientology lore holds that these aliens have destroyed the planet many times before, and the ultimate aim of the religion is to reclaim the Earth and rescue humankind. An OT III individual is one who has vanquished his alien or aliens and come to a higher plane of earthly existence, with OT VIII the highest.

First for Kidman was reaching the initial phase, “Clear,” which means that the individual has mastery over past traumas. This, too, is achieved through auditing. Kidman was a quick study, but after she reached OT II — marked by the removal of untrue ideas, inserted in the brain billions of years prior by thetans — she’d had enough.

The marriage lasted for a number of years, but finally Cruise — and Scientology — turned against Kidman. After the filming of “Eyes Wide Shut” in 2001, Cruise said he wanted out of the marriage. Kidman, now pregnant, was stunned, and two months after they separated, she miscarried.

According to “Going Clear,” Kidman asked that the DNA from the fetus be preserved in order to prove that Cruise was the father. It’s possible she was protecting herself from spurious claims by the church.

Like Rogers before her, Kidman wanted to save the marriage, yet she, too, was dispatched with quickly. She had joint custody of their two adopted children, but Cruise’s army of Scientologists, especially actress Anne Archer’s son, Tommy Davis, “told them over and over again that their mother was a sociopath, and after a while they believed him.”

Cruise continued to rise within the church, and when at international headquarters in Riverside, Calif., he stayed in the guesthouse that once belonged to L. Ron Hubbard. When Cruise got food poisoning there, the chef was banished to the nearby “Happy Valley.” Nominally the church’s “rehab center,” ex-Scientologists maintain that severe physical and mental abuse is meted out there, according to the book. Some church members have been banished to Happy Valley for years. Others are so cut off from society that they have no idea who the president of the United States is. One insurrectionist was forced to clean a bathroom floor using only his tongue (Scientology denies such allegations).

Cruise, meanwhile, was more enmeshed than ever. He was tasked with mentoring a young member, a 16-year-old named Marc Headley, which involved Cruise tutoring him to command an ashtray to balance on its side. The point of such an exercise? “You learn,” said Headley, “that if you don’t do what they say, they’ll just ask the same questions 5 million times.”

Now more than ever, the Church of Scientology was the most important thing in Tom Cruise’s life. He wasn’t just a movie star. He was a transformational leader in a church that claims 8 million members globally, a religious figure with true moral authority and the power to save the planet. Cruise came to believe he had special powers, that he was more equipped to helping a woman suffering postpartum depression than the medical establishment, that addicts would be better off consulting him than in rehab.

Miscavige encouraged Cruise’s grandiosity. Marty Rathbun said that Miscavige told Cruise that they were among a select group of chosen ones, “big beings” who were destined to meet up with LRH on a planet called “Target Two.”

Cruise used his celebrity to lobby Bill Clinton and ex-British Prime Minister Tony Blair in pursuit of tax breaks for the church, which ex-members say has at least $1 billion in holdings.

Cruise was elated yet distracted by more earthly concerns. He was openly complaining about his lack of a girlfriend, and so once again Miscavige tasked church members with solving this problem. Cruise himself held auditions at the Celebrity Centre, under the guise of casting for his next “Mission: Impossible” film. On his list: Lindsay Lohan, Jessica Alba, Kate Bosworth, Scarlett Johansson and Jennifer Garner, whom he found the most compelling.

Also on his list: Katie Holmes. Researchers on the search for Cruise’s next wife had come across a profile of Holmes, in which she spoke of a childhood crush on him.

Their first date was arranged in April 2005. Cruise took her for a night flight over LA in a helicopter stocked with take-out sushi — his typical, over-the-top, getting-to-know-you approach. Two weeks later, Holmes had moved in with him and cut off all contact with her friends and representatives. She was shadowed everywhere. In April 2006, Holmes gave birth to a daughter, Suri, and in November of that year, she and Cruise married.

Cruise, meanwhile, was consumed with his upward trajectory in the church. He had been awarded its Freedom Medal of Valor in 2004 and participated in a video celebrating himself, which leaked online in January 2008. “A Scientologist . . . has the ability to create new or better realities and conditions,” Cruise said. “I’m here to help.”

To his great surprise, not everyone wanted his help. On June 28, 2012, Holmes blindsided Cruise by filing for divorce while he was filming in Iceland. She hired three law firms and even used throwaway prepaid phones to talk with her lawyers and parents. According to reports, Holmes believed that Suri was about to undergo auditing at age 6, and Katie wanted her out of the religion.

For his part, Cruise believes his true aim in life is to convert all nonbelievers into the church, which, according to Scientology, will result in Earth’s salvation. “Look,” he said, “I wish the world was a different place. I’d like to go on vacation, and go and romp and play, you know what I mean? But I can’t. Because I know. I know. I have to do something about it. You can sit here and wish it was different, but there’s that moment where you go, ‘You know, I have to do something. Don’t I?’ ”