TROY — Family members of two young girls screamed and had to be restrained outside a Rensselaer County courtroom Friday morning after a 62-year-old city man was sentenced to five years probation in a sexual abuse case.

William A. Cavanaugh Sr. declined to speak after listening to a relative of the two girls detail how the children have suffered since they were victims of abuse that occurred between 2008 and 2014.

“It pains me to stand here and see the suffering of the family,” Chief Assistant District Attorney Matthew Hauf told County Court Judge Debra Young.

The plea deal was bargained by the administration of District Attorney Joel E. Abelove, who left office a month later after his defeat by Democrat Mary Pat Donnelly.

Cavanaugh was on trial before Young in September when Chief Assistant District Attorney Jessica Hall questioned a witness and raised certain allegations against Cavanaugh that had not been included in the grand jury indictment against him.

That error led Cavanaugh's defense attorney, Lee Kindlon, to make a motion for the mistrial. The prosecution consented to it.

Cavanaugh pleaded guilty to attempted second-degree assault in November. He had initially faced seven felony and three misdemeanor counts that charged him with the continuing sexual abuse of two young girls.

In November, Hall said the plea agreement was in the best interests of justice. A spokesman for Donnelly could not confirm whether Hall is still employed by the office.

Abelove never explained why his office took the plea deal rather than seeking a new trial. Trials of sex crimes, especially those involving years-long abuse of children, often run the risk of re-traumatizing victims.

The victims' families were outraged by the plea deal, which required Cavanaugh to admit to the nonviolent felony that, during the 30 days before July 4, 2008, he rubbed a 6-year-old girl on intimate parts of her body.

If he had been convicted of the top count in the initial indictment — predatory sexual assault against a child — Cavanaugh could have faced a minimum sentence of 10 years to life in prison, and a maximum of 25 years to life.

The initial indictment alleged Cavanaugh sexually assaulted one girl in 2008 when she was 6 years old and again in 2011 when she was 9 years old. It charged he sexually attacked the other girl in 2013 and 2014, when she was 9 and 10 years old.

In addition to the five years of probation, Young imposed an eight-year order of protection forbidding Cavanaugh from coming near the two victims. He will not be required to register as a sex offender.

The Times Union is withholding the names of the victims and their family due to the nature of the crimes.

Cavanaugh's wife, Diane Cavanaugh, was indicted on a felony count of second-degree criminal facilitation, two counts of fourth-degree criminal facilitation and two counts of endangering the welfare of a child.

Abelove's office allowed her to plead to a single count of disorderly conduct.