President Donald Trump’s attorney says Trump’s charity had to cough up $10,000 to buy a 6-foot portrait of him because no one else bid on it at an auction.

Trump’s offer was only intended to “get the bids started” at an auction for the Unicorn Children’s Foundation, a charity for children, at his Mar-a-Lago resort. But, as Trump attorney Alan Futerfas explained to a Manhattan courtroom on Thursday, Trump was “stuck with the painting” when no one else stepped up, and he charged the purchase to his charity.

The embarrassing story was meant to explain why the Donald J. Trump Foundation spent money on things like the portrait — which Trump then hung in a restaurant at his Miami golf resort — not to mention on political contributions, a $100,000 Mar-a-Lago legal settlement, and well-timed charitable donations to boost Trump’s profile during his presidential campaign, according to state investigators.

Hey @Fahrenthold just checked and the portrait is still hanging at the Champions Lounge. How much did you say it cost the Trump Foundation? pic.twitter.com/hGAun6KgCO — Enrique Acevedo (@Enrique_Acevedo) September 21, 2016

The suit accuses Trump and his charity of “a pattern of persistent illegal conduct ... that includes extensive unlawful political coordination with the Trump presidential campaign, repeated and willful self-dealing transactions to benefit Mr. Trump’s personal and business interests, and violations of basic legal obligations for non-profit foundations.”

The suit is demanding that the foundation pay more than $2.8 million in penalties and restitution, that it be shut down, and that Trump and his children be banned from leading other charities in the state. Trump’s daughter Ivanka and his sons Eric and Donald Trump Jr. are also named in the suit.

Futerfas claimed in court that the suit was making a “mountain out of a molehill” and was politically biased. But Yael Fuchs, a lawyer for the state attorney general’s office, insisted that it’s “beyond dispute that these were improper self-dealing transactions,” Bloomberg reported.

Futerfas insisted the money wasn’t used for luxuries for the Trumps. “There are no dinners charged to the foundation. There’s no travel, there’s no cars . . . nothing like that. Travel to Paris — that’s waste,” Futerfas said, reported The Washington Post.

But New York State Supreme Court Justice Saliann Scarpulla said that whether or not the charity paid for trips to Paris for the Trumps, it still has to abide by the law.

“The claim is that there has not been a single board of directors meeting. These individuals are directors. They’re required under state law to have meetings,” Scarpulla said, according to the Post.

She dismissed Futerfas’ claim of political bias.

But she also indicated she plans to hold off on a final decision on the suit until an appellate court rules in a separate case on whether the president has immunity from state court litigation. That case involves former “Apprentice” contestant Summer Zevros, who has accused Trump of groping her and is suing him for defamation for calling her a liar.

Even if the appellate court rules that Trump has immunity from litigation in state court, the charity suit could be modified to target only the charity and Trump’s children without him, Scarpulla indicated.