York County Probate Judge Robert M.A. Nadeau made an unexpected announcement Tuesday at the conclusion a court hearing in a lawsuit against him, saying he may resign from his elected position.

Nadeau left the fate of the lawsuit uncertain when he made the statement to the presiding justice in Cumberland County Superior Court in Portland while packing his files, then put on his jacket and walked out.

Legal woes have been mounting against Nadeau in his capacity as a probate judge. The Maine Supreme Judicial Court is already considering whether to suspend and fine Nadeau for allegations of past infractions. The state Committee on Judicial Responsibility and Disability is considering whether to bring a new round of allegations of misconduct against him. And now a New Hampshire woman who blames Nadeau for her loss of custody of her granddaughter is suing him to undo his control over scheduling in his own courtroom.

Nadeau made his unexpected announcement Tuesday after Justice Thomas Warren rejected two of his motions, one to dismiss the lawsuit on grounds that as a probate court judge he has immunity against such litigation, and another to require the York County government to pay for an attorney to represent him in the case.

At the hearing, Nadeau had to act as his own attorney. He said the cost of hiring his own attorney would likely have drained his entire annual salary of more than $54,000 as a part-time judge.

“I may be submitting my resignation. It’s not worth being a probate judge. It just isn’t worth it,” Nadeau said at the hearing’s end, after Warren rejected his motions.

Warren and the other attorneys in the courtroom appeared surprised to hear Nadeau say that.

“Maybe that changes things. Maybe it doesn’t,” Warren responded.

Robert Mittel, the attorney who represents Renee LeGrand of Effingham, New Hampshire, in the lawsuit, said he doesn’t know whether the case will become moot if Nadeau resigns.

LeGrand is seeking no money in the lawsuit but wants the court to undo changes Nadeau made to his hearing schedule this summer, saying the changes resulted in delays that caused her to lose temporary guardianship of her granddaughter. York County, which pays Nadeau’s salary, is named in the lawsuit as a party of interest.

The lawsuit filed by Mittel and attorney Temma Donahue of Portland, who has been representing LeGrand in the guardianship fight with the girl’s mother, alleges that Nadeau harmed LeGrand by “revamping his schedule in order to delay critical and non-critical court matters by many months, causing constitutional, financial and emotional injury to LeGrand and the other class members.”

LeGrand’s lawsuit also alleges that Nadeau, who was elected to a four-year term in 2012, changed his schedule “to retaliate” against York County commissioners for refusing to substantially increase his salary.

The lawsuit says that on April 15, the county commissioners considered Nadeau’s request to increase his court schedule from two days a week to three or five days a week and to raise his salary to $90,000 or $120,000, from his former salary of $48,498.

Commissioners declined to increase court days, but did grant him a raise, to $54,206. Nadeau immediately changed his court hearing schedule, which the lawsuit alleges caused case delays of several months.

Nadeau has continued to defend his request, citing a backlog in probate cases. He filed a cross-complaint in the lawsuit against York County and county officials, accusing them of five counts, including violating their duty under law to adequately fund the court and undermining Nadeau’s supervisory authority granted to him by voters.

In an email Tuesday evening to Gene Libby, the attorney for York County, Nadeau laid out the conditions under which he would resign. He said he would resign if the county commissioners agree to fund the new judge’s position as a full-time post with the same insurance coverage as judges in the state who are appointed, rather than elected.

“If my resignation is what it will take to convince you and the Commissioners to properly and adequately fund the needs of the families, children, adult incapacitated and other persons dependent upon an overburdened York County Probate Court for service and to properly support the county’s probate judge, (whoever) he or she may be, then that is what I am willing to do,” Nadeau wrote in the email, which he shared with the Portland Press Herald.

Testimony in the lawsuit against Nadeau is next scheduled for a two-day hearing on Jan. 26 and 27.