Gonzales-Mugaburu, 60, who raised dozens of foster children, is on trial before Suffolk County Court Judge Barbara Kahn, charged with sexually abusing six boys and endangering the welfare of two others.

The most serious charge, predatory sexual assault against a child, carries a maximum sentence of 25 years to life. He has pleaded not guilty.

Defense attorney Donald Mates Jr. of Hauppauge said in his opening statement that his client did not abuse the boys, arguing that their stories aren’t credible.

The Wading River man is the second prosecution witness to testify this week that Gonzales-Mugaburu sexually abused him when he was a boy.

The man testified Thursday that he twice caught Gonzales-Mugaburu molesting one of the other boys — on Gonzales-Mugaburu’s bed and in the bedroom closet.

After he himself was sexually assaulted, the man said he fell into depression and started cutting himself. He spent six months at South Oaks Hospital, a psychiatric facility in Amityville. After his release, he said he was sent to live in a residential home for boys in upstate New York.

The man said he lived in foster homes in Florida, Texas and Washington, starting when he was 8.

In summer 2011, when he was 14, the man said he left Washington state to live with Gonzales-Mugaburu. When he arrived, there were three other boys living in the four-bedroom house. For the first two months, the man said his social worker stopped by the Ridge house daily to check on him.