A judge ordered a New Jersey couple Thursday to give a homeless Philadelphia man whatever's left of the $400,000 they raised for him.

Katie McClure and her boyfriend, Mark D'Amico, were told by the Burlington, New Jersey, judge to turn over the remaining money they raised through a GoFundMe campaign for Johnny Bobbitt, according to NBC Philadelphia.

The judge also demanded that McClure and D'Amico provide a full accounting of each dollar they collected, the station reported.

Bobbitt inspired the fundraising campaign after he gave McClure his last $20 when she ran out of gas on a freeway exit ramp last November outside Philadelphia.

Kate McClure, of Florence, New Jersey, and her boyfriend Mark D'Amico raised the funds for Johnny Bobbitt, the homeless vet, after he gave McClure his last $20 when she ran out of gas while driving in Philadelphia. The couple then put together a GoFundMe page that went viral but, 10 months later, Bobbitt's lawyer told NBC News that her client is back on the streets because D'Amico and McClure are withholding the funds. NBC News

The relationship soured, and Bobbitt claimed in court that the money — nearly $403,000 raised from about 14,000 online donors — never fully ended up in his possession.

D'Amico told the Philadelphia Inquirer that he withheld the cash because the veteran allegedly has a drug problem. The couple initially purchased a camper for Bobbit to live in and placed it on property controlled by McClure's family. But Bobbitt was kicked out in June, making him homeless again, according to NBC Philadelphia.

During an appearance Monday on NBC's "Megyn Kelly Today" show, D'Amico said more than $150,000 of the money remained.

He denied misusing the funds but admitted to the Inquirer that he spent $500 of it at a casino. He said he paid it back with money he won. The couple also told the newspaper they once gave Bobbitt $25,000 of the GoFundMe cash, and he spent it within two weeks.

Jacqueline Promislo, an attorney for Bobbitt, said by email that she's "very concerned" that much of the money will be gone by the time it's accounted for.

Asked if Bobbitt might sue to seize some of the couple's personal assets, she said, "We will represent our client to the best of our abilities to recover all of the money raised for him."