A New Jersey man accused of creating an online fundraiser for a homeless veteran to dupe donors out of hundreds of thousands of dollars pleaded guilty Friday as part of a plea deal.

Mark D'Amico's guilty plea to one count of misapplication of entrusted property brings the case against him as well as his girlfriend and the homeless man, each of whom pleaded guilty earlier this year to state and federal charges in connection with the scam, closer to a resolution.

Mark D'Amico at Burlington County Superior Court in Mount Holly, N.J., on May 28, 2019. Tim Tai / The Philadelphia Inquirer via AP, Pool

D'Amico, 39, is expected to be sentenced next April, and has agreed to five years in prison as part of the deal with Burlington County prosecutors, reported NBC Philadelphia.

"We are pleased that this defendant accepted responsibility for his role in this scam," Burlington County Prosecutor Scott Coffina said in a statement Friday. "He will be required to make full restitution to GoFundMe and the donors — the true victims in this case — and has agreed to a five-year term in New Jersey state prison."

D'Amico's plea means he is admitting to spending part of the more than $400,000 collected, but not that he was behind the ruse with girlfriend Kate McClure, 29, and the homeless man, Johnny Bobbitt Jr., 36. He still faces more serious federal charges of conspiracy to commit fraud and money laundering, but any sentence could be served concurrently under the plea agreement.

GoFundMe last year promised to repay all of the donors who gave money in the original campaign, which was first posted in late 2017 and entitled "Paying It Forward."

D'Amico and McClure created the account after she said she ran out of gas near a Philadelphia interstate and bumped into Bobbitt, who used his last $20 to pay for her fuel. The story was so heartwarming that the campaign, which asked for donations to help Bobbitt rent an apartment and get his own car, went viral.

More than 14,000 people ended up donating, and the trio's story became national news and landed them on television.

But their yarn started to unravel when Bobbitt claimed the money that was supposed to go to him was gone and accused D'Amico and McClure of withholding most of the funds.

In announcing charges in November 2018, Burlington County prosecutors said they seized more than 60,000 cellphone messages between McClure and D'Amico that detailed their financial woes, including bills and debts, and how they began thinking of Bobbitt when the idea of a hoax first took root. The money, prosecutors said, was used to pay for lavish vacations for the couple, handbags, clothes and D'Amico's gambling addiction.

Bobbitt was sentenced in April to five years' probation in state court and must help pay back the money.

McClure, who has claimed it was D'Amico who masterminded the scheme, has seen her sentencing dates postponed. She faces four years in state prison and must also repay the money, NBC Philadelphia reported.