Photo: Olivier Douliery/AFP via Getty Images

A judge ordered President Trump to pay $2 million to a group of charities on Thursday, ruling that the president had broken the law by directing the proceeds from an event advertised as benefiting veterans to his presidential campaign instead.

The lawsuit stems from the wild days of the 2016 Republican primary. Because of a feud he maintained with Fox News at the time, Trump decided to skip a debate hosted by the network just before the Iowa caucuses in January 2016, and hold his own, competing event instead — a televised fundraiser for veterans. But rather than having the foundation run the event and direct all proceeds to the charities, as promised, Trump did something quite different. As New York State Supreme Court Justice Saliann Scarpulla put it in her decision on Thursday:

Mr. Trump’s fiduciary duty breaches included allowing his campaign to orchestrate the Fundraiser, allowing his campaign, instead of the Foundation, to direct distribution of the Funds, and using the Fundraiser and distribution of the Funds to further Mr. Trump’s political campaign.

Though the campaign took charge of the $2.8 million raised at the fundraiser — in violation of the law, which restricted it to the foundation — the money did eventually make its way to veterans groups, as promised. The $2 million Trump was ordered to pay on Thursday, meanwhile, will go to organizations like the United Negro College Fund and the U.S. Holocaust Memorial Museum.

The lawsuit was brought by New York State attorney general Barbara Underwood, who announced last year that the Trump Organization would shut down amid her investigations into its well-documented chicanery. Though Trump had said on Twitter that he would fight the fundraiser case, his lawyers and the state have been in talks for months to negotiate a settlement.

It’s a loss for Trump, but $2 million is a minor blow in his universe — and the judge could have been harsher. She decided not to impose any punitive damages on the president, nor impose lifetime bans on him and his children from serving on the boards of New York–based charities in the future, conditions the state had been seeking. (Though she did put into place other restrictions involving his future charitable endeavors.)

Trump suffered another legal setback on Monday, when a federal appeals court ordered him to produce eight years of his personal and corporate tax returns, in a case likely headed for the Supreme Court.

This post has been updated and clarified to reflect that the money raised at the fundraiser in question did go to veterans.