Donald J. Trump’s civil fraud trial went out with a bang on Thursday, with the former president delivering an impassioned defense during closing arguments.

Mr. Trump attacked both the New York attorney general who brought the case and the judge overseeing it, casting himself as a victim of what he claimed was their partisan crusade against him. The attorney general’s office countered that, leaving aside his denials and antics, Mr. Trump orchestrated a sweeping fraud in which he inflated his net worth to obtain favorable loans and other benefits.

The dueling narratives marked a chaotic end to a trial that had unnerved Mr. Trump and threatened his family business.

Now, after a monthslong proceeding, which featured reams of documents and testimony from Mr. Trump and his adult sons, the decision rests with the judge, Arthur F. Engoron. There is no jury.