A California mother and father subdued and duct-taped a registered sex offender who they caught standing in their 5-year-old daughter’s bedroom early Tuesday after he broke in through a window, authorities said.

The parents caught a man, who deputies later identified as 39-year-old registered sex offender Daniel Diaz, prowling outside their home in Grayson around 5 a.m., FOX40 Sacramento reported, citing the Stanislaus County Sheriff’s Office.

CALIFORNIA MAN SHOOTS AND KILLS ARMED INTRUDER WHO KICKED HIS DOOR DOWN: POLICE

The family told local news stations the man was looking through their windows and touching himself.

"He was in the living room window trying to peek in and he was grabbing his private parts and just looking around," the girl’s mother Martha Zepeda told WLTX-TV in Spanish through a translator.

Daniel Diaz, 39, was arrested outside the home in Grayson early Tuesday, authorities said.

Daniel Diaz, 39, was arrested outside the home in Grayson early Tuesday, authorities said. (Stanislaus County Sheriff’s Office)

But the father lost sight of the man as he walked around the outside of the house, according to the family, until they heard a loud noise come from their 5-year-old daughter’s bedroom.

Diaz had removed a screen for the window to the daughter’s room and crawled into the home, authorities said.

"The man turned on the lights and that’s when my sister woke up and she got scared," Ceci Ramirez, the girl’s older sister, told KOVR-TV.

CLICK HERE TO GET THE FOX NEWS APP

The father rushed the man and forced him outside, where he wrestled him to the ground, authorities said. He and his wife restrained him using duct tape as they waited for officers to arrive.

Diaz, a registered sex offender on the Megan’s Law website, was convicted in 2009 of assault with intent to commit rape in 2009 and released in 2018, according to local stations.

Diaz was arrested and charged with child endangerment, home invasion, and peeping and prowling. He was being held on $150,000 bond, according to online jail records.