A South Jersey man pleaded guilty Friday to state charges in the GoFundMe scam that raised more than $400,000 from donors around the world for homeless veteran Johnny Bobbitt Jr.

Under an agreement with prosecutors, Mark D’Amico pleaded guilty in a Mount Holly courtroom to a second-degree felony charge of misapplication of entrusted property, and faces a five-year prison sentence. He could apply to an intensive-probation program after serving seven months in custody, his attorney said.

D’Amico’s sentencing on the state charge was deferred until the outcome of a federal case, in which he is charged with one count each of conspiring to commit wire fraud and conspiring to commit money laundering. Superior Court Judge Terrence Cook on Friday tentatively set April 24, 2020, for D’Amico’s sentencing.

Defense attorney Mark Davis told reporters after the surprise plea hearing that D’Amico did not plead guilty to conspiring with his former girlfriend, Katelyn McClure, to set up the GoFundMe account, and that D’Amico was not the mastermind behind the scam. As part of the agreement with prosecutors, conspiracy, theft and other charges were withdrawn.

“What he pled guilty to today was only with respect to what he did,” Davis said. The lawyer contended that unlike Bobbitt and McClure, who worked as a secretary for the New Jersey Department of Transportation, D’Amico did not defraud any of the more than 14,320 GoFundMe donors.

Authorities have said that McClure and D’Amico, a carpenter, concocted the fake story about McClure’s driving into Philadelphia on a cold October 2017 night, and with her car sputtering out of gas, pulling onto an I-95 exit ramp where she became stranded. Luckily, they said, Bobbitt, who sat on the guardrail at the exit ramp, used his last $20 to buy her gas.

To repay Bobbitt’s act of kindness, the tale went, McClure and D’Amico, who at the time lived together in Burlington County, came up with the GoFundMe campaign to help get Bobbitt off the streets.

The feel-good story went viral, and donors worldwide contributed to help Bobbitt, a Marine veteran. The three appeared on national television to promote the campaign.

In reality, McClure was not stranded, Bobbitt did not buy gas for her, and McClure and D’Amico spent a substantial amount of the money raised in the online campaign on themselves.

McClure has admitted that she and D’Amico used donations for vacations, casino gambling, a BMW, two trucks, designer handbags, and other purchases. Authorities learned that the three had actually met near what was then the SugarHouse Casino in Philadelphia in the fall of 2017, then concocted the fake story.

Within a few months of the campaign, all of the money was gone. Once Bobbitt realized the money had been squandered, he sued D’Amico and McClure, alleging in August 2018 that he had only received about $75,000 of the funds raised on his behalf.

The charge to which D’Amico pleaded guilty Friday, Davis said, was “misapplying funds” that D’Amico “was holding for Bobbitt.”

D’Amico, 40, arrived at the Mount Holly courthouse dressed in a long-sleeve forest-green shirt, black vest jacket, and ripped blue jeans. He said little during the brief hearing except to agree with his lawyer and the judge that he was pleading guilty.

The plea required him to say only that he took more than $75,000 designated for Bobbitt’s benefit.

But he, McClure, and Bobbitt together are responsible to repay GoFundMe the $402,706 raised in the scam. Superior Court has not determined how much each of the three must pay. GoFundMe agreed to reimburse all of the donors.

Assistant Burlington County Prosecutor Andrew McDonnell told the judge that D’Amico’s state sentence would run concurrently with whatever sentence he may receive in his federal case.

D’Amico, however, faces a maximum federal sentence of 30 years in prison on two charges. A trial date has not been set.

After Friday’s plea, D’Amico declined to comment.

McClure, 29, also of Burlington County, and Bobbitt, 36, of Philadelphia, had pleaded guilty to conspiracy charges in federal court in March. They await sentencing.

Burlington County Prosecutor Scott Coffina took note Friday of the timing of D’Amico’s guilty plea.

“Today’s proceeding presents an opportunity to remind the public during the holidays to be cautious when considering making a charitable contribution,” Coffina said in a statement. “Do your research, and make sure you are donating to a worthwhile cause.”