A Virginia dad walked in on a relative visiting for the holidays allegedly molesting his two toddlers — and beat him to a pulp, authorities said Thursday.

The father, who wasn’t publicly identified, decided to check in on his kids, ages 2 and 3, early on Sunday and found 60-year-old Mark Stanley in their bedroom “nude from the waist down,” the Spotsylvania Sheriff’s Office said in a statement.

“When the [father] questioned what he was doing in the room, Mr. Stanley pushed [him] out of the room, then locking the door,” deputies said in the release. “The [father] forced entry into the room and began beating Mr. Stanley.”

When deputies arrived, they found the dad holding a handgun and approaching Stanley, who had “severe injuries to his face.”

Sheriff’s Capt. Liz Scott told the Fredericksburg Free Lance-Star that the deputies’ intervention may have saved the creep’s life.

Stanley, who had been in town from North Carolina, was charged with two counts of taking indecent liberties with a child and assault. He could face additional charges following an investigation, cops said.

He was held in Rappahannock Regional Jail without bond.

The children were taken to a hospital to be evaluated for possible injuries. Their dad wasn’t charged.