The man accused of sending a series of sexually-graphic letters to Kamloops, B.C., elementary schools may have gotten closer to students than previously thought.

RCMP officials said Monday they were monitoring the suspect when he entered a school, and that's what triggered the arrest.

It happened at Valleyview Secondary on Thursday.

"When he was under surveillance, we had no indication at all that he was going to go into the school," said RCMP Staff Sgt. Gary Kerr. "We had no idea where he was going at that point. But once he went into the school, it was obviously, there was more of a concern there."

For a brief moment, police lost sight of him.

That, in turn, led to a lockdown of the school.

Police eventually found the suspect and asked him to leave the school before arresting him.

Lowell James Swetman, 45, has been charged with possession of child pornography, criminal harassment, and sending obscene material through the mail. He remains in custody.

Seven letters were sent to five schools in the area over a two-week period. All the letters contained obscene and explicit content targeting young girls.

Police said they got a break after releasing a photograph of an envelope containing one of the letters. Someone recognized the handwriting.

With files from CTV British Columbia's Kent Molgat