SOUTH PASADENA, Calif. — Investigators acting on a tip unraveled a plot to carry out a mass shooting at a suburban Los Angeles high school, arresting a pair of students who planned to target three school staffers and kill as many people as possible, police said Tuesday.

School officials learned of the plot on Thursday and notified detectives, who began watching the 16- and 17-year-old boys and monitoring their online activity, South Pasadena Police Chief Arthur Miller said.

The pair didn’t have a date for an attack or weapons, but their online messaging included the names of three staffers to target and threats to randomly kill students, Miller said.

They were also researching automatic firearms, handguns, knives, explosives and tactical techniques, he said.

“Three or four days’ worth of surveillance on the Internet indicated that they had a very real threat,” he said. “They had a plan in mind that they were going to execute.”

The names of the teens have not been released because of their ages. Police expected to present their case to the district attorney later in the day.

Miller said police interviewed the boys and realized how cold-hearted the plot was. He provided no specifics, and officials at South Pasadena High School did not disclose details of the initial tip.

The two teenage boys, who were about to become seniors, were arrested on charges of making threats and conspiracy. They were being held at a juvenile facility.

Miller said the suspects’ parents were cooperating with investigators.