A man remains under police guard in hospital after allegedly attacking a young girl in a Sydney dance class bathroom and then stabbing a father who came to the seven-year-old’s aid.

The alleged paedophile snatched the little girl when she was on the way to the bathroom at the Kogarah studio on Thursday night.

Police say the 54-year-old walked in off the street and forced the girl into the men’s toilets where she was sexually assaulted.

According to 7 News, the man was already on parole for sex offences.

Camera Icon The alleged predator remains in hospital under police guard. Credit: 7 News

The girl’s mother noticed she was missing as other dance parents joined the search — finding a locked toilet cubicle.

A parent kicked down the door where it is alleged the predator was naked from the waist down.

“He just stabbed him in the stomach ... he had a slash in the back of the neck going from the back all the way to his ear,” witness Mohamad Hariri said.

“Someone came out and yelled ‘call the police he’s trying to kill him’.”

The attack only ended when another man punched the alleged predator in the face.

Camera Icon The alleged paedophile snatched the little girl when she was on the way to the bathroom at the Sydney studio. Credit: 7 News

According 7 News, investigators are looking at the possibility that the little girl was being held inside the locked cubicle for more than half an hour. ​

She's told police that the man had her at knife point and told her to not make a sound or he'll kill her. ​

The 46-year-old parent was taken to St George Hospital in a stable condition while the girl was taken to Sydney Children’s Hospital for observation. Both are now recovering at home.

The 54-year-old alleged attacker was arrested and taken to hospital with facial swelling and bruising. He remains under guard and is set to be questioned next week.