The state’s highest court on Thursday unanimously upheld a ruling that Suffolk County cannot be held liable for employing a convicted sex offender who groped an adult female student at a North Amityville building where Western BOCES held classes.

The county had sent Larry Smith, now 67, to work as a custodian at the school building on Commerce Boulevard in North Amityville as part of a “welfare to work” program in 2006. People with criminal records were not supposed to work at the school, according to the Court of Appeals decision, but Smith had convictions for raping young girls in both 1985 and 1994. He had served his sentences for those crimes.

In March 2006, Smith was charged with sexually assaulting a 36-year-old woman in a classroom. She sued the county, but the Court of Appeals said Suffolk, like all municipalities in New York State, is generally immune from negligence claims.

The only exceptions are if the municipality is not acting in a governmental role or if it owes a “special duty” to the injured person “beyond what was owed to the public generally.”

advertisement | advertise on newsday

Neither exception applied in this case, the court ruled in a 10-page decision.

Attorneys for both the county and the woman who filed the suit did not respond to requests for comment.