Once upon a time in Hollywood, two stars on the rise made a movie with their pals — then fiercely fought for decades to keep it from seeing the light of day.

Those actors, now worldwide superstars, were Leonardo DiCaprio and Tobey Maguire. And the flick is “Don’s Plum” — an ad-libbed, mid-1990s indie film that’s been banned from ever being shown in the US and Canada.

“ ‘Don’s Plum’ was a group of friends saying, ‘Let’s all make a movie …,’ ” one of the flick’s producers, Dale Wheatley, recently told The Post. “In many ways, [it] was a love letter to our friends.”

Though rumors and articles have circulated about “Don’s Plum” over the years, court documents, footage of depositions from the actors, images and other materials exclusively obtained by The Post tell the full story of the movie DiCaprio and Maguire never want you to see.

Shot over six days between July ‘95 and March ‘96 in “Clerks”-like black-and-white style, it tells the story of a group of 20-something guys who gather every Saturday night at a Los Angeles diner the film is named for, each with a new girl.

In it, DiCaprio plays rude, standoffish Derek, whose standout lines are: “Do you girls masturbate at all?” and “I’ll f–king throw a bottle at your face, you goddamn whore.” He does then throw a glass — at Amber Benson of “Buffy the Vampire Slayer” fame — in a cringe-inducing scene meant to scare the actress away from the set.

Maguire’s character, Ian, meanwhile, in one scene — which was cut from the final version of the film at his behest — reveals his unusual masturbation habits.

The characters the stars portray are “not necessarily who [DiCaprio and Maguire] are,” said Tawd Beckman, one of the producers.

“But of course it is so free-flowing and it seems so natural, that an audience is gonna look at that, look at DiCaprio, look at Maguire and say, ‘Oh, that’s who they are.’ ”

It’s for that reason that Wheatley, Beckman and others suspect DiCaprio and Maguire didn’t want US audiences to ever see their characters on the big screen.

In depositions given as part of a 1998 lawsuit — which resulted in the film being banned in the country — DiCaprio and Maguire said it was because they never meant for the film school-like project to become a full-length feature.

In the aftermath, DiCaprio moved on to unimaginable fame and star-studded projects, and Maguire got his big break as “Spider-Man.”

But the others involved, like Wheatley, had to live with the fallout: ruined careers, destroyed friendships, divorce and thoughts of suicide.

****

In the “Don’s Plum” days, DiCaprio was fresh off his Academy Award nomination for “What’s Eating Gilbert Grape.” Meanwhile, Maguire was trying to build himself as a marketable performer in Hollywood, having just made waves in “This Boy’s Life.”

At the time, they had a growing reputation as obnoxious, skirt-chasing party boys — part of the so-called “Pussy Posse,” a moniker bestowed on the group by Nancy Jo Sales in her seminal 1998 New York Magazine piece, “Leo Prince of The City.”

“The group’s core members constitute a frat house of young men, some of whom are actually famous, like Leo …,” Sales wrote. “And then there are the other guys in Leo’s pack, who make up a kind of former-child-actor brigade.”

“Don’s Plum” makes a cameo in the article, with Sales writing that it “may provide an inadvertent glimpse behind the curtain shrouding the secret society of Leo and his friends, mostly because it was made and largely ad-libbed by Leo and his friends.”

Just weeks into moving to Los Angeles, wide-eyed Canada transplant Wheatley says, he fell in with the Posse — including DiCaprio, Maguire, Kevin Connolly and R.D. Robb — after an introduction from Jeremy Sisto of “Clueless” fame.

Wheatley was starstruck the moment he laid eyes on DiCaprio — and had his own aspirations of making it big.

“I was obsessed with success …,” Wheatley said. “I didn’t come to LA to stare up at the Hollywood sign, I wanted to make something of myself.”

An advantage of hanging with DiCaprio’s crew was that “there wasn’t a club I couldn’t get into, there wasn’t a famous person that didn’t want to meet us,” Wheatley said.

‘We believed we were making a film with our friends and foolishly didn’t pay attention to paperwork.’

“We were really in one of the most-watched circles in Hollywood at the time.”

Wheatley collaborated with aspiring filmmakers David Stutman and Beckman on the project that eventually became “Don’s Plum.”

DiCaprio was in.

“Having that guy in your corner obviously means that the rest are probably going to follow him,” Wheatley said. “That’s exactly what happened. Everybody got excited about the experiment.”

Former child actor Robb, who appeared in 1983’s “A Christmas Story,” was tapped to direct. Later, as Sales would note for NY Mag, he was “‘expelled’ from the [Posse], according to someone still inside it, for attempting to spin the film’s straw into the Leo gold of a commercial release.” Robb didn’t respond to multiple requests for comment.

Meanwhile, Stutman went to Beckman’s dad, Jerry Beckman — who helped to create the Happy Meal and Monopoly — for about $70,000 in funding.

When it came to contracts, the naive first-time filmmakers went with handshake deals.

“We believed we were making a film with our friends and foolishly didn’t pay attention to paperwork,” Wheatley said. “‘Don’s Plum’ was on the road to failing because of our inexperience and our lack of prep.”

To take the project to the next level, the amateurs brought on two experienced producers, John Schindler and Gary Lowe.

As the group filmed in the LA diner, Wheatley said, he was amazed at the “improvs that were coming out.”

On DiCaprio’s last day on set, “we’re outside by the car and I’m just overwhelmed with gratitude,” Wheatley said.

“I just can’t believe what he has done for us. And I’m expressing that … and I give him this really big hug …,” Wheatley recalled. “And then he just says, ‘Just make me look good.’ God damn it. You know he’s like, ‘Just make me look good.’ And it was like something happened for me, in terms of like a responsibility, not to him alone.”

After his two days of filming on “Don’s Plum,” DiCaprio flew off to work on 1996’s “Marvin’s Room” with Diane Keaton, Meryl Streep and Robert De Niro.

With an additional shoot, which DiCaprio wasn’t involved in, the team had about 30 hours of actual film and Wheatley was fired up about having done what he believed was nearly impossible — a feature on his first try.

“Nobody expected that we could pull off the kind of movie that deserves a full-on theatrical release, a big festival run …,” he said. “We pulled it off, and you know, we finally got there.”

Beckman added that, especially for Robb and Stutman, “There was this idea that we’re going to make millions of dollars from this film.”

“And everybody’s going to be big, all of the careers are going to open up for us … as opposed to getting our foot in the door, they were like, ‘This is our path to kick it down.’ ”

****

When DiCaprio learned his pals wanted to turn the project into a feature, he was “immediately apprehensive,” Wheatley said.

‘There was this idea that we’re going to make millions of dollars from this film.’

“Leo was like, ‘Guys, I don’t want this to be a feature film. I can’t afford a bad feature film to go out right now. That’s just not going to work for my career,’ ” Wheatley recalled.

According to Wheatley, DiCaprio was convinced the film would be a flop, but agreed to let his pals cut it as a feature to see how it would turn out.

“So when he heard that we thought we might be able to kind of feature together, he was concerned, and look, he had good reason to be concerned,” Wheatley said.

“He’s a rising star. He’s becoming one of the great actors of our time and he can’t be having joint missteps along the way … we were empathetic to that.”

Wheatley and others involved believed the movie they cut was a work of art — on par with 1994’s “Clerks” or Harmony Korine’s 1995 cult classic “Kids.”

Jerry Meadors, who’d worked on dozens of movie projects as a marketing exec at Paramount, convinced the group to announce that “Don’s Plum” was completed — in a short June 21, 1996, Variety piece written by future Deadline editor Anita Busch.

The item said DiCaprio and Maguire had “quietly shot an indie feature film” that also starred Connolly and Scott Bloom, and listed Robb as director, with Beckman and Meadors as executive producers.

Though DiCaprio was “livid” over the item, Wheatley and others said his reaction to a screening of the film in late June at LA’s MGM Plaza was radically different.

“Suddenly he was jumping out of his chair,” Wheatley said. “He’s high-fiving all of our friends … Leo had done a complete 180.”

Beckman added: “Leo was literally rolling on the floor laughing.”

Next, Wheatley said, he arranged a screening at CAA, DiCaprio’s agency, at the actor’s behest. The agency loved the film so much, they signed Robb “on the spot,” Wheatley said.

Offers began pouring in, including from now-disgraced producer Harvey Weinstein’s Miramax, Wheatley said.

But when Maguire and his agent saw the feature, they allegedly weren’t pleased.

The flick was too edgy for Maguire’s image and “he thought it would ruin his career,” Lowe said.

There also was DiCaprio’s stellar performance to contend with.

“I could definitely see Maguire, as I knew him, feeling that Leo had outshined him, and that possibly being part of the motivating factor for wanting to kill this film,” Beckman said.

So it was a boost when DiCaprio seemed to adore the movie.

“Tobey Maguire believed ‘Don’s Plum’ would just be a pile of crap, we weren’t going to succeed, Leo’s going to say ‘no’ … but that’s not what happened,” Wheatley said.

“There’s no way to make it stop now unless he creates a villain … and I am the mark for that.”

Amid a chaotic blowout at Wheatley and Robb’s apartment, Maguire accused his so-called friends of trying to take advantage of his and DiCaprio’s budding fame, Wheatley said.

Wheatley “panicked” and revealed the Variety article had been Meadors’ idea as a way to show DiCaprio “that at least we have a voice in the press,” he recalled.

“And holy s–t, he exploded. Tobey f—ing lost his mind.”

In a rage, Maguire yelled: “I want ‘Don’s Plum’ to burn!” Wheatley claimed.

Maguire told DiCaprio the others had tried to pit the press against him in order to push through the feature film they wanted, Wheatley and others said.

‘I could definitely see Maguire, as I knew him, feeling that Leo had outshined him.’

In a 1996 interview for now-defunct Detour magazine, DiCaprio said: “I had a friend who I did a short film with recently who slandered me … I was trying to do a favor for him. His name is R.D. Robb. It’s scandalous. It was originally a short film, and then he tried to make it into a feature. I worked one night on it … And I heard all this stuff about how he was going to pit the press against me if I didn’t go along with him and do the feature. I just did it as a favor, you know?”

Wheatley said he begged Maguire not to say anything, arguing, “I don’t even know the first thing that would even mean to pit the press against Leo. He is my friend. You are my friend. We love you guys, we made this movie together.”

“[Maguire] was one of my closest friends and I believed that … he could understand everything. [That] he could understand the fear as we struggled to get this film made,” Wheatley recalled. “But he was there to destroy the movie.”

“All of the work. It all died that day,” he said. “In that moment, it was done …”

****

Soon after, potential deals from production companies to option the movie fell apart.

As Sales reported in 1998: “The film was pulled from Sundance. Miramax is no longer interested in investing.”

At that point, “all of my relationships are completely gone, I’ve got a dead film, I can’t get anywhere … I am blacklisted,” Wheatley said.

The creators, including Stutman, Robb, Wheatley and Meadors, fought back, filing a $10 million lawsuit in LA Superior Court against DiCaprio and Maguire, accusing them of building a campaign to tank the movie by making “potential buyers, distributors and others afraid to offend DiCaprio.”

According to Schindler, DiCaprio and Maguire responded by counter-suing.

In deposition tapes shared with The Post, DiCaprio insists the film was always meant to be a short and that the defendants tried repeatedly to convince him to agree to a full-length movie that he never wanted.

Meanwhile, Maguire said he felt like the producers were throwing away their friendships to try to pursue their own success.

“They were behaving as people with an agenda, rather than my friends,” he testified.

After a lengthy back-and-forth, the parties eventually settled.

As part of the settlement agreement, obtained by The Post, the plaintiffs had to agree to scrap some lines from the movie, including one in which DiCaprio says “gay guys f–k like rabbits” and one in which Maguire says, “You know what, I beat off and I stick my pinkie up … not in my ass …” — and then admits he does. Still, though the parties agreed not to release the movie in the US and Canada, Danish director Lars von Trier showed it at the 2001 Berlin Film Festival.

A review of the film from the festival gives it a B+, praising DiCaprio’s performance, but noting: “Unfortunately, odds are you won’t be able to see it without buying the eventual video from overseas, as the court settlement with DiCaprio and Maguire prohibits any form of release in North America. Ingrates. What’s the matter, fellas — afraid people might get the right idea?”

Wheatley and Robb, bound by the settlement agreement, had to remain tight-lipped about the ordeal and were only allowed to say: “We are so glad that we are able to put the ‘Don’s Plum’ dispute behind us amicably and we look forward to releasing the film to the rest of the world.”

Despite being barred from speaking about the details of the lawsuit and settlement, Wheatley has spoken publicly in the past, including in an open letter published online and to Vanity Fair in 2016.

“Don’s Plum” was released in multiple European countries and in Japan, though the majority of the profits went to legal fees — Wheatley says he made just $180 from the movie.

Eventually, Wheatley gave up his dreams of making it big in Hollywood. But he never forgot “Don’s Plum.”

Beckman’s father — the inventor of the Happy Meal — never did either.

‘These guys are terribly intimidating with their power and their influence.’

In 2005, he sued Stutman — who had never paid back his original loan — to retrieve the investment, and won the rights to the flick. Stutman declined to speak to The Post on the record.

Wheatley, still obsessed with “Don’s Plum,” decided in 2014 to upload the movie to a website called freedonsplum.com. The movie stayed up on the site for 16 months, until about a month before DiCaprio would win his Oscar for “The Revenant” in 2016.

His plans to get his magnum opus out there were foiled again, and the web page reads: “We have removed your video titled ‘Don’s Plum,’ previously available at Vimeo, in a response to a takedown notice submitted by Leonardo DiCaprio and Tobey Maguire pursuant to the Digital Millennium Copyright Act (DMCA.’)”

“They weren’t the Pussy Posse, they were the bully posse,” Wheatley charged. “These guys are terribly intimidating with their power and their influence.”

“McGuire destroyed my life. He destroyed my career. For the last 20 years I’ve been living in the rubble of the destruction that he created …”

A spokesperson for DiCaprio said: “The events and comments described in this story are decades-old lies fabricated by Dale Wheatley in an effort to gain publicity and unlawful financial gain.”

Reps for Maguire didn’t comment.