A fallen Wall Street honcho cut a half-a-million dollar check Monday to resolve a messy dispute with a former brokerage client that nearly landed him behind bars.

Tommy Belesis, the former owner of brokerage firm John Thomas Financial, jumped up and raised his hand in Manhattan federal court Monday when Judge Katherine Forrest asked if he appeared — as per her orders.

Belesis’s lawyer, Michael Schwartz, then told the judge that his client has forked over $534,492.50 to resolve the dispute over money owed a Louisiana spinal doctor and former JTF client.

The seemingly simple dispute turned ugly last month when the doctor, Eubulus Kerr, accused Belesis of lying under oath about his wealth in order to avoid paying the money he owed, which stood at more than $1 million this summer.

Judge Forrest issued the arrest threat after the Belesis’ skipped a hearing in the case.

“This is the kind of proceeding that should never have required the effort it has required,” Judge Forrest said Monday. “This is not intellectually stimulating for any of us,” she said.

Lawyers for Kerr says Belesis still owes some $230,000 in legal fees, prompting Judge Forrest to warn Belesis and his wife that she expects them to resolve the issue over the remaining money with considerably less drama or she will order them to testify as to their true wealth.

“I will put you on the witness stand,” she said. “And if you lie to me, I will refer you to the US Attorney’s Office for prosecution.”

Belesis, who advised Oliver Stone on the “Wall Street” sequel at the height of his career, testified in December that he is now so poor that he had to borrow money for a cab to his Midtown Manhattan deposition.

A few months later, he filled out a mortgage application claiming $144 million in assets, Kerr’s lawyers told the judge.

Belesis’s brokerage firm was once so posh it boasted attendants in the men’s bathrooms. But it shuttered in 2013 amid probes by the Securities and Exchange Commission and Finra, which accused Belesis of intimidating brokers and threatening to improperly hamper their ability to get other jobs.