It was a tale that warmed hearts around the world — a homeless vet forking over his last $20 to help a distressed driver gas up her car in the dead of night.

But the truth is more stomach-turner than heart-warmer.

The hero, the woman he “saved” and her boyfriend were a trio of scam artists who knew each other for a month before the so-called chance encounter — and the $400,000 they raised on GoFundMe was blown on luxury items and gambling trips that included a lavish New Year’s trip to Las Vegas, officials said Thursday.

“The entire campaign was predicated on a lie,” said Burlington County, NJ, prosecutor Scott Coffina in announcing criminal charges against couple Mark D’Amico and Kate McClure and vagrant Johnny Bobbitt.

“[McClure] did not run out of gas on an I-95 off-ramp, and [Bobbitt] did not spend his last $20 to help her,” Coffina said. “Rather, D’Amico, McClure and Bobbitt conspired to fabricate and promote a feel-good story that would compel donors to contribute to their cause.”

The Florence Township couple had already known Bobbitt for at least a month before their “Paying It Forward” campaign went live on Nov. 10, 2017, spotting him panhandling by an underpass during their frequent gambling jaunts to Philadelphia’s SugarHouse Casino.

Their first interactions even started with the same kindness they’d later project on their bogus GoFundMe campaign, with the couple spotting Bobbitt 10 bucks here, a hot cup of coffee there, officials said.

“[I don’t know] why but that homeless guy by sugarhouse [sic] just keeps popping in my damn head today,” McClure, 28, text messaged her boyfriend on Oct. 16, 2017.

“Dude I just thought about him!!” replied D’Amico, 39, as the conversation turned to ways to help out the 35-year-old former Marine: Food, clothes, a Nintendo Switch, even a job and a house.

Less than a month later, it was Bobbitt who supposedly came to McClure’s rescue when her car clunked out — off the same Girard Avenue exit ramp where the trio first met.

McClure’s tank ran bone-dry along a desolate, litter-strewn stretch of I-95, forcing her to hike to the nearest gas station in the dark — or so the story posted to the GoFundMe page went.

“I never ran out of gas before, and my heart was beating out of my chest. I pulled over as far as I could, and got out of the car to head to the nearest gas station,” she wrote.

“That’s when I met Johnny. … He told me to get back in the car and lock the doors. A few minutes later, he comes back with a red gas can. Using his last 20 dollars to make sure I could get home safe.”

In reality, it took McClure less than an hour after the campaign went live for her to tell her skeptical best friend that the too-good-to-be-true tale was exactly that.

“The gas part is completely made up … but the guy isn’t,” she texted to the friend, whom officials didn’t identify by name. “I had to make something up to make people feel bad … So, shush about the made up part.”

It worked: Between the drive’s launch and conclusion on Dec. 11, some 14,347 donors chipped in $402,706 to help Johnny, rocketing past the initial $10,000 goal.

The trio’s touching tale made them overnight sensations, as they embarked on a media blitz that saw the story covered on “Good Morning America” and “The Ellen Show,” and in outlets around the globe.

Bobbitt battled to kick his nagging drug habit, bought a home, and received a job offer from Amazon, while the couple negotiated a book deal.

But behind the scenes, McClure was feeling the heat, even getting guilted by her own mother for the ruse.

“My mother just called me and said that people go to jail for scamming others out of money. So there’s that,” she texted her friend. “That’s what my own mother thinks of me.”

Meanwhile, relations strained between Bobbitt and the couple, who allegedly kept the bulk of the $367,108.81 they received after GoFundMe took its cut for processing fees.

Bobbitt claimed he received only about $75,000, while McClure and D’Amico blew through the rest on everything from a 2015 BMW to designer shoes and sunglasses to a New Year’s trip to Las Vegas and a helicopter flight over the Grand Canyon.

Over $85,000 was withdrawn by the couple in or near casinos from Vegas to Atlantic City to Philly, financial records revealed to investigators.

“You really need to get rid of [Bobbitt] and get the public off your back by donating,” McClure’s friend warned her in March. “He could out you.”

McClure replied, “I’ll be keeping the rest of the money, f–k you very much.”

But even if McClure was willing to heed her friend’s advice, it was too late.

“I can’t believe we have less than 10k left,” she texted D’Amico earlier that month. “I’m so upset.”

D’Amico shrugged off his girlfriend’s concerns, confident that the payday from the book deal he was shopping would eclipse the GoFundMe payment.

Bobbitt was not as calm; in August, he finally snapped, taking McClure and D’Amico to court claiming they’d bilked him out of the windfall earned on the back of his supposed good deed.

The couple countered that they were stiffing Bobbitt for his own good, because he was using the money to feed his resurfaced heroin habit.

“Giving him all that money, it’s never going to happen,” D’Amico told Philly.com at the time. “I’ll burn it in front of him.”

Privately, D’Amico was still clinging to his hopes of parlaying a book deal out of the flap, even floating a title throwing Bobbitt under the bus: “No Good Deed.”

But it was his and McClure’s greed that likely doomed the scam, officials said Thursday.

Had Bobbitt gotten a larger cut and not sued the couple, bringing investigators sniffing around, “there’s a good chance” the scheme never would’ve been uncovered, Coffina said.

Still believing Bobbitt to be the victim, investigators raided the couple’s home in September, and also seized a trove of electronic records, including bank statements and over 60,000 text messages.

D’Amico and McClure bickered over the scam as it crumbled before their eyes.

“Twenty thousand [dollars], BMW. Five thousand, Disney [World and Land trips]. Ten thousand in bags. We both went to Vegas, right?” D’Amico wrote. “Like you act like you didn’t spend a dollar.”

Wrote McClure the next day, “I wish that you never updated the GoFundMe. Like we shoulda just let it go and not f–king kept people informed.”

As they unwound the twisted tale, authorities also dug into Bobbitt’s past and found that in 2012 he recounted a nearly identical tale on Twitter while he was living in North Carolina.

“So this girl runs out of gas and has a flat tire at the same time in front of Wal-Mart and is blocking traffic,” he wrote. “So I run to the gas station and hen change her tire. I spent the only cash I had for supper but at least she can get her little children home safe.”

Officials couldn’t say Thursday whether that good deed had actually happened and merely inspired the 2017 tale or was an early test run of the fabrication.

Either way, “I don’t think that’s a coincidence,” Coffina said.

Bobbitt “deserves our appreciation for his willingness to serve our country as a United States Marine and he has our sympathy and concern for the homelessness that he’s experienced, as well as his publicized struggle with addiction,” Coffina added.

“But it is imperative to keep in mind that he was fully complicit in the scheme to defraud contributors.”

McClure and D’Amico were taken into custody Wednesday, processed and released, while Bobbitt was arrested in Philadelphia and is awaiting extradition to New Jersey.

All three face charges of theft by deception, and conspiracy to commit theft by deception, punishable by five to 10 years behind bars.

A lawyer representing the couple declined to comment, and there was no answer at their Florence, NJ, home on Thursday.

Multiple calls to an attorney representing Bobbitt went unanswered.

As for the money, investigators are still trying to account for every penny, but Coffina said it’s believed “zero” is left.

GoFundMe said in a statement that everyone who donated to help Bobbitt would be fully refunded in the coming days.

“It was fictitious and illegal,” said Coffina. “And there are consequences.”