RIDLEY PARK — A 12-year-old Ridley Middle School student allegedly named several students, a teacher and the school principal in a Facebook post, saying he was bringing a weapon to school on Tuesday and would gun them down, authorities said.

The boy, who is not being named because of his age, was taken into custody Tuesday morning and charged with terroristic threats, unlawful use of a computer and harassment, according to Delaware County District Attorney Jack Whelan.

“It was a hoax, but we take anything that is put on Facebook that threatens a child in a school or otherwise very seriously and we act accordingly,” Whelan said.

According to Whelan, the boy set up an account on Facebook in another seventh-grade student’s name several months ago. That victim had nothing to do with the hoax, Whelan said.

On Monday, the 12-year-old allegedly posted on Facebook that he was going to bring a gun into school on Tuesday and shoot people. Whelan said the suspect named about 10 students, a teacher and the principal as targets.

Detectives from the Delaware County Internet Crimes Against Children Task Force worked through the night to identify the young suspect, authorities said.

Investigators obtained search warrants for the IP address of the computer that was the source of the threats. They obtained the street address of where the computer was located and went to the house and spoke with the student and his mother, Whelan said. Authorities said the boy claimed to have been bullied by classmates.

“I certainly was impressed by the way our ICAC unit responded and addressed the potential threat and did so within a few brief hours,” Whelan said. “They were able to make sure the school was made aware there was no threat and parents could send their children to school.”

The district attorney noted that shortly after investigators spoke with the suspect, at about 7 or 7:30 a.m. Tuesday, they notified the district to let officials know the threat had been removed. At that point, the district sent out an alert notifying parents the matter was resolved and that it was safe to send their children to school, he said.

“The school acted diligently and appropriately,” Whelan said of the notification, adding that school district officials could not send out that alert until they were notified by law enforcement authorities.

Ridley School District Superintendent Lee Ann Wentzel confirmed there was a higher rate of absenteeism at Ridley Middle School on Tuesday as a result of the Facebook threat. She did not say exactly how many of the 1,300 students at the middle school stayed home.

Wentzel said she is satisfied with the police effort, including that of Delaware County detectives, in resolving the case before the opening of school on Tuesday. She said rumors that the threats were made last week are unfounded. The incident, she said, occurred Monday.

“Police were at the school (Tuesday) to provide a visible sense of security and the administration staff was also there,” the superintendent said. “Our No. 1 priority, after educating our children, is to provide security for the safety of our children and staff.”

The superintendent also noted there is a filter in place in district schools that blocks the Facebook site.

The threat, she said, was made by the student at his home.

“The district does not use Facebook as a global site. We prefer to deal with our children face-to-face, with parents, and not through the media,” Wentzel said.

One woman, who asked not to be identified, kept her 13-year-old son home from school Tuesday.

“If he went to school and something happened to him, I would never forgive myself,” she said. “I think this is disgraceful. This boy (who posted the threats) upset the entire community.”

The woman said she considered the Facebook incident a terrorist act.

“When I called the school to report my son’s absence and I was asked why he would be absent, I told them because of the incident that happened. It was a terrorist act, basically,” she said.

The woman’s son, a seventh-grader, called the Facebook threat “bad.”

“I think it was supposed to be a joke, but it wasn’t. It was serious,” the student said.

The boy who allegedly perpetrated the hoax is being held at the Delaware County Juvenile Detention Center in Middletown, awaiting an adjudication hearing.