Johnny Bobbitt Jr. pleaded guilty Friday to conspiracy to commit theft by deception for his role in a $400,000 GoFundMe scam that duped more than 14,000 donors across the country and beyond.

During a 20-minute hearing in Superior Court in Mount Holly, Bobbitt, 36, agreed to testify against his coconspirators and cooperate with state authorities. He is expected to serve five years’ probation and be accepted into a program that will allow him to avoid prison if he remains drug-free. If he doesn’t complete the program, which offers intensive court-monitored treatment and rehabilitation to people with addiction problems, he faces up to five years in state prison.

In 2017, prosecutors say, Bobbitt, then homeless, conspired with a Burlington County couple to create a false narrative that he used his last $20 to help a stranded Katelyn McClure when she ran out of a gas on a winter night on an I-95 off-ramp in Philadelphia. McClure and her then-boyfriend, Mark D’Amico, started a GoFundMe campaign that touted that Good Samaritan story and professed to raise money to get Bobbitt off the street.

The campaign went viral, and Bobbitt appeared with the couple on national television to spread their story. As donations poured in, prosecutors say, McClure and D’Amico spent the bulk of the money on vacations, casino excursions, a BMW, and luxury goods. They bought Bobbitt a camper, and he lived in it for a time on a property McClure’s family owned in Florence Township. They also gave him about $25,000, some of which he spent on drugs.

On Wednesday, in federal court in Camden, Bobbitt pleaded guilty to a single count of conspiracy to commit money laundering. He faces 6 to 30 months in federal prison. U.S. District Judge Jerome Simandle agreed to postpone sentencing on the federal charges until he completes the drug program.

McClure, 28, also pleaded guilty in federal court Wednesday to one count of conspiracy to commit wire fraud. She faces up to 33 months in prison when she is sentenced on June 19. She also faces conspiracy to theft by deception charges filed by Burlington County prosecutors. That case is pending.

D’Amico, 39, faces the same criminal charges in the pending Burlington County case. Prosecutors have not said whether he will face federal charges.

Bobbitt will enter drug treatment following his sentencing hearing, which is scheduled for April 12.

On Friday, Judge Christopher J. Garrenger said he would work with the attorneys to move the date up so Bobbitt can start treatment sooner. He will remain in the Burlington County Jail until he is placed in rehab. After sentencing, Bobbitt will be sent to a nearby treatment facility, where he could spend three to nine months in the initial phase.

Bobbitt, who wore a baggy, prison-issued orange jumpsuit in court Friday, hung his head and stared at the floor for most of the hearing.

Outside the courtroom, Bobbitt’s defense attorney John Keesler said, “He’s focused on getting well and moving on with his life."