New York (AFP) – Last year, the seemingly heartwarming tale of a homeless good Samaritan who helped a woman driver in need sparked a crowdfunding campaign that raised hundreds of thousands of dollars for him.

Now, the story has ended up in court — and appears to have been a scam.

Three people were charged in a New Jersey courtroom on Thursday in connection with the allegedly fraudulent scheme, which allowed them to rake in more than $400,000 on the GoFundMe site.

In November 2017, Katelyn McClure and her boyfriend Mark D’Amico launched the crowdfunding page asking donors to “pay it forward” to a homeless military veteran, Johnny Bobbitt Jr.

The couple said Bobbitt had given McClure his last $20 to buy gas for her car when he found her stuck along a highway outside Philadelphia, and they wanted to return the act of kindness.

The GoFundMe page announced a goal of $10,000 to help Bobbitt rent an apartment, buy a used car and get back on his feet. But it quickly made that amount many times over.

The story made headlines and thousands donated to what seemed to be a good cause.

But the first twist came in August when Bobbitt sued McClure and D’Amico, saying he had only received a fraction of the money — about $75,000 — and accusing the couple of pulling one over on donors.

Bobbitt claimed the couple had gone on fancy vacations and bought themselves a new BMW, which was seized at the couple’s home in September.

Ultimately, the investigation revealed a second twist: Bobbitt was in cahoots with the couple all along. 

“The entire campaign was predicated on a lie,” Burlington County prosecutor Scott Coffina told a press conference Thursday.

“Less than an hour after the GoFundMe campaign went live, McClure, in a text exchange with a friend, stated that the story about Bobbitt assisting her was ‘completely made up’,” he said.

“She did not run out of gas on an I-95 off-ramp, and he did not spend his last $20 to help her,” the prosecutor added.

“D’Amico, McClure and Bobbitt conspired to fabricate and promote a feel-good story that would compel donors to contribute to their cause.”

The three were charged with “theft by deception” and conspiracy to commit such a theft. A spokesman for the prosecutor’s office said they would be seeking jail sentences “of some length.”

GoFundMe plans to reimburse the 14,000 donors, who contributed $403,000, the prosecutor said.