NEW YORK (AP) — A judge has ruled that Donald Trump committed fraud for years while building the real estate empire that catapulted him to fame and the White House.

Judge Arthur Engoron, ruling Tuesday in a civil lawsuit brought by New York’s attorney general, found that the former president and his company deceived banks, insurers and others by massively overvaluing his assets and exaggerating his net worth on paperwork used in making deals and securing financing.

The decision, days before the start of a non-jury trial in Attorney General Letitia James’ lawsuit, is the strongest repudiation yet of Trump’s carefully coiffed image as a wealthy and shrewd real estate mogul turned political powerhouse.

Beyond mere bragging about his riches, Trump, his company and key executives repeatedly lied about them on his annual financial statements, reaping rewards such as favorable loan terms and lower insurance premiums, Engoron found.

Those tactics crossed a line and violated the law, the judge said, rejecting Trump’s contention that a disclaimer on the financial statements absolved him of any wrongdoing.

Manhattan prosecutors had looked into bringing a criminal case over the same conduct but declined to do so, leaving James to sue Trump and seek penalties that could disrupt his and his family’s ability to do business in the state.

Engoron’s ruling, in a phase of the case known as summary judgment, resolves the key claim in James’ lawsuit, but six others remain.

Engoron is slated to hold a non-jury trial starting Oct. 2 before deciding on those claims and any punishments he may impose. James is seeking $250 million in penalties and a ban on Trump doing business in New York, his home state. The trial could last into December, Engoron has said.

Trump’s lawyers had asked the judge to throw out the case, which he denied. They contend that James wasn’t legally allowed to file the lawsuit because there isn’t any evidence that the public was harmed by Trump’s actions. They also argued that many of the allegations in the lawsuit were barred by the statute of limitations.