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.

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. Bobbitt claims he has only received $150,000 of the money.

The couple admitted to inside edition the money was put in their personal account.

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.

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.”