In 2005, the world was introduced to reclusive billionaire Jeffrey Epstein, friend to princes and an American president, a power broker with the darkest of secrets: He was also a pedophile, accused of recruiting dozens of underage girls into a sex-slave network, buying their silence and moving along, although he has been convicted of only one count of soliciting prostitution from a minor.

Visitors to his private Caribbean island, known as “Orgy Island,” have included Bill Clinton, Prince Andrew and Stephen Hawking.

According to a 2011 court filing by alleged Epstein victim Virginia Roberts Giuffre, she saw Clinton and Prince Andrew on the island but never saw the former president do anything improper. Giuffre has accused Prince Andrew of having sex with her when she was a minor, a charge Buckingham Palace denies.

“Epstein lives less than one mile away from me in Palm Beach,” author James Patterson tells The Post. In the 11 years since Epstein was investigated and charged by the Palm Beach police department, ultimately copping a plea and serving 13 months on one charge of soliciting prostitution from a 14-year-old girl, Patterson has remained obsessed with the case.

“He’s a fascinating character to read about,” Patterson says. “What is he thinking? Who is he?”

Patterson’s new book, “Filthy Rich: A Powerful Billionaire, the Sex Scandal That Undid Him, and All the Justice That Money Can Buy,” is an attempt to answer such questions. Co-authored with John Connolly and Tim Malloy, the book contains detailed police interviews with girls who alleged sexual abuse by Epstein and others in his circle. Giuffre alleged that Epstein’s ex-girlfriend Ghislaine Maxwell, daughter of the late media tycoon Robert Maxwell, abused her. Ghislaine Maxwell has denied allegations of enabling abuse.

Epstein has spent the bulk of his adult life cultivating relationships with the world’s most powerful men. Flight logs show that from 2001 to 2003, Bill Clinton flew on Epstein’s private plane, dubbed “The Lolita Express” by the press, 26 times. After Epstein’s arrest in July 2006, federal tax records show Epstein donated $25,000 to the Clinton Foundation that year.

Epstein was also a regular visitor to Donald Trump’s Mar-a-Lago, and the two were friends. According to the Daily Mail, Trump was a frequent dinner guest at Epstein’s home, which was often full of barely dressed models. In 2003, New York magazine reported that Trump also attended a dinner party at Epstein’s honoring Bill Clinton.

Last year, The Guardian reported that Epstein’s “little black book” contained contact numbers for A-listers including Tony Blair, Naomi Campbell, Dustin Hoffman, Michael Bloomberg and Richard Branson.

In a 2006 court filing, Palm Beach police noted that a search of Epstein’s home uncovered two hidden cameras. The Mirror reported that in 2015, a 6-year-old civil lawsuit filed by “Jane Doe No. 3,” believed to be the now-married Giuffre, alleged that Epstein wired his mansion with hidden cameras, secretly recording orgies involving his prominent friends and underage girls. The ultimate purpose: blackmail, according to court papers.

“Jane Doe No. 3” also alleged that she had been forced to have sex with “numerous prominent American politicians, powerful business executives, a well-known prime minister, and other world leaders.”

“We uncovered a lot of details about the police investigation and a lot about the girls, what happened to them, the effect on their lives,” Patterson says.

“The reader has to ask: Was justice done here or not?”

Epstein, now 63, has always been something of an international man of mystery. Born in Brooklyn, Epstein had a middle-class upbringing: His father worked for the Parks Department, and his parents stressed hard work and education.

Epstein was brilliant, skipping two grades and graduating Lafayette HS in 1969. He attended Cooper Union but dropped out in 1971 and by 1973 was teaching calculus and physics at Dalton, where he tutored the son of a Bear Stearns exec. Soon, Epstein applied his facility with numbers on Wall Street but left Bear Stearns under a cloud in 1981. He formed his own business, J. Epstein & Co.

The bar for entry at the new firm was high. According to a 2002 profile in New York magazine, Epstein only took on clients who turned over $1 billion, at minimum, for him to manage. Clients also had to pay a flat fee and sign power of attorney over to Epstein, allowing him to do whatever he saw fit with their money.

Still, no one knew exactly what Epstein did, or how he was able to amass a personal billion-dollar-plus fortune. In addition to a block-long, nine-story mansion on Manhattan’s Upper East Side, Epstein also owns the $6.8 million mansion in Palm Beach, an $18 million property in New Mexico, the 70-acre private Caribbean island, a helicopter, a Gulfstream IV and a Boeing 727.

“My belief is that Jeff maintains some sort of money-management firm, though you won’t get a straight answer from him,” one high-level investor told New York magazine. “He once told me he had 300 people working for him, and I’ve also heard that he manages Rockefeller money. But one never knows. It’s like looking at the Wizard of Oz — there may be less there than meets the eye.”

“He’s very enigmatic,” Rosa Monckton told Vanity Fair in 2003. Monckton was the former British CEO of Tiffany & Co. and confidante to the late Princess Diana. She was also a close friend of Epstein’s since the 1980s. “He never reveals his hand . . . He’s a classic iceberg. What you see is not what you get.”

Both profiles intimated that Epstein had a predilection for young women but never went further. In the New York magazine piece, Trump said Epstein’s self-professed image as a loner, an egghead and a teetotaler was not wholly accurate.

“I’ve known Jeff for 15 years,” Trump said. “Terrific guy. He’s a lot of fun to be with. It is even said that he likes beautiful women as much as I do, and many of them are on the younger side. No doubt about it — Jeffrey enjoys his social life.”

Three years after that profile ran, Palm Beach Police Officer Michele Pagan got a disturbing message. A woman reported that her 14-year-old stepdaughter confided to a friend that she’d had sex with an older man for money. The man’s name was Jeff, and he lived in a mansion on a cul-de-sac.

Pagan persuaded the woman to bring her stepdaughter down to be interviewed. In his book, Patterson calls the girl Mary. And Mary, like so many of the other girls who eventually talked, came from the little-known working-class areas surrounding Palm Beach.

A friend of a friend, Mary said, told her she could make hundreds of dollars in one hour, just for massaging some middle-aged guy’s feet. Lots of other girls had been doing it, some three times a week.

Mary claimed she had been driven to the mansion on El Brillo Way, where a female staffer escorted her up a pink-carpeted staircase, then into a room with a massage table, an armoire topped with sex toys and a photo of a little girl pulling her underwear off.

Epstein entered the room, wearing only a towel, Mary said.

“He took off the towel,” Mary told Officer Pagan. “He was a really built guy. But his wee-wee was very tiny.”

Mary said Epstein got on the table and barked orders at her. She told police she was alone in the room with him, terrified.

Pagan wrote the following in her incident report:

“She removed her pants, leaving her thong panties on. She straddled his back, whereby her exposed buttocks were touching Epstein’s exposed buttocks. Epstein then turned to his side and started to rub his penis in an up-and-down motion. Epstein pulled out a purple vibrator and began to massage Mary’s vaginal area.”

Palm Beach assigned six more detectives to the investigation. They conducted a “trash pull” of Epstein’s garbage, sifting through paper with phone numbers, used condoms, toothbrushes, worn underwear. In one pull, police found a piece of paper with Mary’s phone number on it, along with the number of the person who recruited her.

On Sept. 11, 2005, detectives got another break. Alison, as she’s called in the book, told Detective Joe Recarey that she had been going to Epstein’s house since she was 16. Alison had been working at the Wellington Green Mall, saving up for a trip to Maine, when a friend told her, “You can get a plane ticket in two hours . . . We can go give this guy a massage and he’ll pay $200,” according to her statement to the police.

Alison told Recarey that she visited Epstein hundreds of times. She said he had bought her a new 2005 Dodge Neon, plane tickets, and gave her spending money. Alison said he even asked her to emancipate from her parents so she could live with him full time as his “sex slave.”

She said Epstein slowly escalated his sexual requests, and despite Alison’s insistence that they never have intercourse, alleged, “This one time . . . he bent me over the table and put himself in me. Without my permission.”

Alison then asked if what Epstein had done to her was rape and spoke of her abject fear of him.

An abridged version of her witness statement, as recounted in the book:

Alison: Before I say anything else . . . um, is there a possibility that I’m gonna have to go to court or anything?

Recarey: I mean, what he did to you is a crime. I’m not gonna lie to you.

Alison: Would you consider it rape, what he did?

Recarey: If he put himself inside you without permission . . . That, that is a crime. That is a crime.

Alison: I don’t want my family to find out about this . . . ’Cause Jeffrey’s gonna get me. You guys realize that, right? . . . I’m not safe now. I’m not safe.

Recarey: Why do you say you’re not safe? Has he said he’s hurt people before?

Alison: Well, I’ve heard him make threats to people on the telephone, yeah. Of course.

Recarey: You’re gonna die? You’re gonna break your legs? Or — Alison: All of the above!

Alison also told Recarey that Epstein got so violent with her that he ripped out her hair and threw her around. “I mean,” she said, “there’s been nights that I walked out of there barely able to walk, um, from him being so rough.”

Two months later, Recarey interviewed Epstein’s former house manager of 11 years, documented in his probable-cause affidavit as Mr. Alessi. “Alessi stated Epstein receives three massages a day . . . towards the end of his employment, the masseuses . . . appeared to be 16 or 17 years of age at the most . . . [Alessi] would have to wash off a massager/vibrator and a long rubber penis, which were in the sink after the massage.”

Another house manager, Alfredo Rodriguez, told Recarey that very young girls were giving Epstein massages at least twice a day, and in one instance, Epstein had Rodriguez deliver one dozen roses to Mary, at her high school.

In May 2006, the Palm Beach Police Department filed a probable-cause affidavit, asking prosecutors to charge Epstein with four counts of unlawful sexual activity with a minor — a second-degree felony — and one count of lewd and lascivious molestation of a 14-year-old minor, also a second-degree felony.

Palm Beach prosecutors said the evidence was weak, and after presenting the case to a grand jury, Epstein was charged with only one count of felony solicitation of prostitution. In 2008, he pleaded guilty and nominally served 13 months of an 18-month sentence in a county jail: Epstein spent one day a week there, the other six out on “work release.”

Today, Jeffrey Epstein is a free man, albeit one who routinely settles civil lawsuits against him, brought by young women, out of court. As of 2015, Epstein had settled multiple such cases.

Giuffre has sued Ghislaine Maxwell in Manhattan federal court, charging defamation — saying Maxwell stated Giuffre lied about Maxwell’s recruitment of her and other underage girls. Epstein has been called upon to testify in court this month, on Oct. 20.

The true number of Epstein’s victims may never be known.

He will be a registered sex offender for the rest of his life, not that it fazes him.

“I’m not a sexual predator, I’m an ‘offender,’ ” Epstein told The Post in 2011. “It’s the difference between a murderer and a person who steals a bagel.”