WOODBURY - A state court on Friday removed a threat of firing hanging over Vineland Solicitor Richard Tonetta since an epic falling out with the city's mayor last fall.

Gloucester County Superior Court Judge Ann McDonnell tossed a lawsuit Mayor Ruben Bermudez filed on Jan. 9 against Tonetta and the City Council. The council was involved because it had blocked the firing.

Attorney William Harla, who represented Tonetta and the council, said the ruling really wasn't much of a surprise to him.

"Ultimately, it's actually a straightforward case and there's lots of law on it," Harla said.

The legal setback was the second in two days for the mayor, who on Thursday saw another state court grant extra time to collect petition signatures to a group trying to force a mayoral recall election.

Harla said the judge noted her authority ends with the decision. She did cite a New Jersey Supreme Court ruling on a similar situation in asking all parties to make an effort to get along, he said.

Tonetta and Bermudez, along with his wife, attended the morning hearing.

Tonetta later declined comment on the decision, leaving it to his attorney. Bermudez could not be reached for comment.

The chain of events started on Nov. 15, 2013, with Bermudez calling Tonetta in for an unscheduled meeting and asking for his resignation.

Later, the mayor only would say that he had "lost confidence" in Tonetta.

N.J. law gives council the right to overturn such a firing on a super-majority vote. On Nov. 24, at a special meeting, the council voted 5-0 to keep Tonetta.

Cherry Hill attorney Mary Lou Garty, who also appeared for the mayor at Thursday's court hearing, argued that professional ethics should have led Tonetta to resign.

That argument is based on an ethics rule that calls on attorneys to remove themselves from cases when a client no longer wants them. McDonnell held that the ethics are different for a government attorney like Tonetta, who actually represents the entire city rather than only the mayor.

"There was obviously a very clear distinction between what the law actually reads and what the mayor's interpretation was,'' City Council President Anthony Fanucci said late Friday.

"It's unfortunate that such extreme measures had to be taken by entering the court of law."