An Atlantic City firefighter fired because he allegedly engaged in sexual contact with two 16-year-old girls while on duty is entitled to a new administrative hearing -- and a new judge, an appellate panel ruled today.

Richard Williams Jr. was accused in 2009 of inviting four females -- including two 16-year-olds -- into Fire Station 2 for pizza. It was alleged that, while the teens were inside the station at Indiana and Baltic avenues, he sexually gratified himself in front of them.

The incident sparked several demonstrations and allegations of racism: Williams is white and the teens are black.

A criminal investigation by the Atlantic County Prosecutor's Office followed, but no charges were filed after then-Prosecutor Ted Housel said the girls were all of the age of consent and all the acts were consensual.

Williams denied the allegations, saying the witnesses were not reliable.

He was terminated in 2011, with Administrative Law Judge Bruce Gorman finding Williams engaged in unbecoming conduct and misused public property.

But Gorman should not have overseen the case, the panel ruled, because his son is a member of the law firm representing a 19-year-old woman involved in the case in a civil suit against the city.

"The employment of (Gorman's) son as an associate in the firm representing (the woman), and the lack of recusal of (the judge) irretrievably tainted the action taken thereafter by the Commission, and its decision must be set aside," the judges found.

Williams now gets a new hearing.

"Mr. Williams looks forward to a new trial, to being completely exonerated, and to being reinstated as an Atlantic City firefighter, a job that he honorably held for years," Williams' attorney, Joseph Levin, said.

"Whatever the law is, we'll abide by it," Fire Chief Dennis Brooks said after learning of the decision.