A 35-year-old man was arrested Monday and charged with criminal trespass after he "unlawfully entered" Walt Whitman High School in Huntington Station on April 11, taking photographs before leaving the scene, police said.

Police said James Rankin, of Roxbury Street, Huntington Station, is a graduate of the school and that he entered the building at about 3:50 a.m. through "an unlocked door."

advertisement | advertise on newsday

"He didn't commit any crime other than the trespass," a police spokeswoman said Tuesday, saying investigators believe he had "no ill intentions" when he entered the building.

The trespass was captured on surveillance cameras, and Rankin was seen leaving the scene in a light-colored sedan, police said.

Rankin had been the subject of a Suffolk County Crime Stoppers alert, but it was not immediately clear how police obtained the information leading to his arrest.