NEW YORK (AP) — Former New York City Mayor Rudy Giuliani beat a contempt order and avoided jail Monday in an ongoing dispute over money he owes to his third wife, Judith Giuliani, as part of a divorce settlement reached three years ago.

At a brief court hearing, Giuliani said he’s making progress in paying the debt, though he and Judith remain far apart on how much he still owes for things like her country club memberships, condominium fees and health care.

Judge Michael Katz lifted the contempt order he issued after Giuliani missed a September court date. At the time, Judith Giuliani said the ex-mayor owed her more than $260,000. Katz had given Giuliani a final warning at a hearing a few weeks later, telling him the sheriff was “on notice to come at a moment’s notice” to jail him if he didn’t pay up.

Giuliani, also known for his work as former President Donald Trump’s personal lawyer, has since provided copies of $150,000 worth of checks he’s written to Judith and said he paid another $45,000 on Sept. 9, Katz said.

“It seems to me that he’s shown proof of payment,” Katz said Monday. “I am going to direct that he makes those payments and to remain current with any other obligations under the stipulation.”

Katz, exasperated with both sides, added: “I am hoping this is the last time I have to sit through this kind of exercise.”

Giuliani, who represented himself, praised Katz as “very fair” and quipped that the judge had finally “seen the reason why I’m not married to her.”

Outside the courthouse, Giuliani celebrated his freedom by quizzing reporters with “The Godfather” trivia, ranting about Hunter Biden’s laptop and plugging his radio show.

Judith Giuliani, in a telephone interview, said she found Katz’s decision “quite baffling” and that the matter is far from over.

Judith Giuliani said her ex-husband, once hailed as America’s Mayor for his leadership after 9/11, is still in arrears to the tune of hundreds of thousands of dollars and that her lawyers will be taking him to court again if he doesn’t pay up. Giuliani disputes that, saying he owes about $14,000.

“The bottom line is that Rudy is what Rudy always is,” Judith Giuliani said. “He learned how to avoid the system, as we see in every other case that he’s done.”

Judith Giuliani said she agreed to the settlement in 2019 — rather than taking $40,000 in monthly support payments a judge awarded — as a favor to Giuliani, who was facing mounting costs at the time stemming from an investigation into his work in Ukraine.

Giuliani has since been under scrutiny for his efforts to overturn Trump’s 2020 election loss, as well as his actions prior to the Jan. 6 riot at the U.S. Capitol. He alluded in court Monday to still more financial trouble, saying one check he wrote to Judith, for $30,000, bounced.

Katz quickly tired of the bickering couple, snapping at Judith Giuliani as she tried interrupting him and chiding Rudy Giuliani for talking in “apples and oranges” and attempting to submit evidence after a deadline.

“I don’t know why everyone thinks this is a free-for-all,” Katz said.

Lamenting that the case had turned him into an accountant, poring over checks, the judge said: “It seems everyone’s record-keeping in this case is very poor.”

Rudy Giuliani, 78, insisted in court that he could write a $5,000 check immediately to cover various costs, but said as he was leaving court that he needed to know what name to write on it.

“Judith,” someone from his ex-wife’s legal team responded. “Giuliani. It’s your name.”