By Tara Vreeland, The News On 6

MUSKOGEE, OK -- Security cameras in a Muskogee middle school are credited with helping police catch a man who police say tried to abduct a student.  Muskogee Police also credit the quick thinking actions of a 15-year-old girl after a man tried to convince her to leave the school with him.

A Dallas man is in jail after police say he tried to kidnap a girl from the 7th and 8th Grade Center in Muskogee.  Police say 40-year-old James Smith tried to get the student to leave with him. He went into the school around 1:30 on Tuesday afternoon, telling the girl he was her father and she needed to go with him

"What scares me and what worries me is what were his intentions once he got her outside," said Muskogee Police Lt. Bobby Lee.

Smith is a registered sex offender who has a first-degree rape conviction.

"When I watched the video you could tell she was scared and she took off running for the office to get away from this man," said Muskogee Police Lt. Bobby Lee.

Police say Smith got into the school with a woman he claims was his sister, who was looking in on her own child. The school says it was an elaborate plan to get the girl out of the building.

"This gentleman handled this all wrong. There are legal ways to do things and he went about it the illegal way," said Muskogee Police Lt. Bobby Lee.

"Using the cameras we were able to identify the man, identify his vehicle outside, contacted campus security as well as the Muskogee PD and were able to have the man apprehended," said Principal Debra Barger.

The school, like many schools, has implemented systems like locked doors, security guards, and surveillance cameras, all in place to protect the students.

"It was excellent video of the whole ordeal," said Muskogee Police Lt. Bobby Lee.

"We have lockdown drills, we have all the safety drills that are required but we also try to make sure the kids know it's not just a drill, but what if something really happens," said Principal Debra Barger.

And, when it really happened, a 15-year-old girl got herself out of a potentially dangerous situation.

"She did everything right," said Muskogee Police Lt. Bobby Lee.

Muskogee Police are looking into the possibility that Smith may in fact be the girl's father. But, even so, he should not have attempted to contact the girl in that manner.

Smith is being held in the Muskogee County Detention Facility without bond.

The Muskogee Count Assistant District Attorney says Smith will formally be charged on Friday with attempted kidnapping of a child and conspiracy.