President Donald Trump must pay a $2 million judgment for improperly using his Trump Foundation charity to further his 2016 presidential campaign, a New York state judge ruled Thursday.

The order appears to bring to an end the New York attorney general's lawsuit against the president and three of his oldest children over the now-shuttered foundation, which the attorney general said had engaged in repeated wrongdoing.

“Our petition detailed a shocking pattern of illegality involving the Trump Foundation — including unlawful coordination with the Trump presidential campaign, repeated and willful self-dealing, and much more," then-Attorney General Barbara Underwood alleged in a statement late last year.

In her seven-page ruling, New York Supreme Court Justice Salliann Scarpulla wrote, "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."