NEW YORK -- Disgraced former congressman Anthony Weiner and his estranged wife, Hillary Clinton aide Huma Abedin, seemed more like a couple than not as they appeared briefly before a judge on Wednesday in their divorce case.

They sat side by side and chatted casually for several minutes while their lawyers met with state Supreme Court Justice Michael L. Katz before the jurist briefly took the bench. After the hearing concluded, they walked out of the courtroom and past photographers to an elevator, standing in the rear while it descended.

Abedin, who was a top aide to Clinton during her unsuccessful 2016 Democratic presidential bid, split with Weiner after he repeatedly sent sexually explicit material to other women.

Weiner, who unsuccessfully ran for mayor in 2005 and 2013, is to be sentenced this month for sending obscene material to a 15-year-old girl. He's eligible for a harsh term of years in prison but is likely to face less time. As part of his plea bargain, he agreed not to appeal any sentence between 21 and 27 months.

Abedin, in a black skirt, and Weiner, in a blue suit, walked down a long set of stairs together at the courthouse's entrance as they departed. They declined a reporter's invitation to comment.

A man passing by on the sidewalk shouted, "Anthony Weiner!"

"How you doing, buddy?" Weiner called back.

Weiner, a Democrat who resigned his seat in Congress in 2011 over his penchant for sexually explicit texts and social media posts to various women, asked photographers and videographers if they had gotten what they needed before he followed Abedin into the back seat of a black sports utility vehicle.

Earlier, in open court, there was no discussion about the requests by lawyers that parts of the case be sealed because it involves visitation for Weiner and Abedin's young child.

Attempts to keep the proceedings quiet have failed, and the judge allowed a news photographer in the courtroom with them.

"I would encourage you to work out a plan together with your attorneys' assistance," the judge told them.

An FBI investigation into Weiner's online relationship with a 15-year-old North Carolina girl became a factor in the presidential election. Then-FBI Director James Comey announced in late October 2016 that an investigation into emails that had been kept on Clinton's private server needed to be reopened while the bureau looked at emails found during the Weiner probe.

Although Comey announced two days before the November election that nothing was found in the new search that would result in charges against Clinton, she has cited it as a reason for her loss to Donald Trump.

Trump, a Republican, became president in January and dismissed Comey in May.

Weiner was leading several 2013 mayoral race polls until it was revealed he had continued his questionable behaviour after his resignation from Congress. That failed mayoral bid is the subject of the documentary "Weiner."