ROCKLAND — A teenager who police say threatened to shoot up Oceanside High School was arrested in Portland and is being held in the Knox County Jail on a misdemeanor terrorizing charge.

Isiah B. Perry, 19, had made a threat via text messages that he would shoot a 14-year-old Thomaston girl and then said he would shoot up Oceanside High School, according to an affidavit filed in court by the Rockland Police Department.

Perry was believed to be staying at a homeless shelter in Portland and Portland police were notified. They located Perry and arrested him Thursday night. Portland police took him to Wiscasset, where Rockland police took custody and brought Perry to the Knox County Jail.

Perry was initially charged with suspicion of felony terrorizing, but the district attorney’s office formally charged him with misdemeanor terrorizing on Friday. Assistant District Attorney Christopher Fernald said that for a felony charge to be lodged under state law, the threat would have had to result in a lockdown or evacuation.

He is listed as a transient, but also listed as having a Union residence.

Bail was set at $500 cash during a brief hearing Friday in Knox County Court. He remained at the jail late Friday afternoon.

Thomaston police initially investigated Perry’s alleged threats and referred the matter to Rockland police when it was learned the threats involved Oceanside High. Rockland police notified Regional School Unit 13 Superintendent John McDonald, who was prepared to cancel school on Friday if Perry was not apprehended, the affidavit said.

The affidavit said that Perry may have mental health problems. Bail conditions included that he not be on any RSU 13 properties, and not be in Thomaston.

The affidavit stated that Perry claimed to black out at times and did not mean harm to anyone. He told police he owned an old, double-barreled shotgun but did not know if it worked.

The affidavit said Perry is known to police and the school. The affidavit said Perry has sneaked into the high school and donned disguises last month to get on school buses even though he was not a student.

Police issued him an order not to be on school grounds and warned him he could be charged with criminal trespass.

Comments are not available on this story.