A 31-year-old man has been arrested in connection with an attack on a girl at Nepean High School in March.

Ottawa police arrested Daniel Phillip Rief on Monday, nearly three months after a 15-year-old girl reported being followed into a washroom and attacked by an unknown male at about 7:30 a.m. on March 31.

The girl was allegedly grabbed from behind and knocked to the floor. She managed to fight off her attacker by kicking and screaming with self defence techniques she learned in gym class.

The man fled the school, and the female student escaped unharmed.

"It's good news for the school. It's closed at this time of year. It had generated a lot of concern in the community," said Staff-Sgt. John McGetrick.

At the time of the incident, Nepean High School heightened security and asked students to report any suspicious visitors. Now, students are relieved a suspect is in custody.

"It's safer now. Nothing like that should ever happen again," said one student.

"There was a lot of surprise. As everybody knows, Nepean is a great school in a great area so we wouldn't think it would happen too much," added another.

Rief is charged with one count of assault, one count of forcible confinement and one count of escaping lawful custody. He initially got away when police tried to arrest him, but later turned himself in.

Investigators say Rief was known to police, but would not specify for what reasons.

With a report from CTV Ottawa's Norman Fetterley