The mountain lion wandered down from the hills near the John F. Kennedy High School campus in Granada Hills around noon, California Department Fish and Wildlife Information Officer Andrew Hughan told ABC News.
Video shows the mountain lion wandering through the high school's outdoor pathways and even sprinting across a long stretch of concrete at one point. It is then seen scaling a large wall before moving on to a residential neighborhood.
The Department of Fish and Wildlife responded to the scene, along with the Los Angeles County Fire Department and about 40 officers from the Los Angeles Police Department, who cordoned off the area and closed all streets within a block of the high school, Hughan said.
Wildlife officials were able to contain the animal to a few square blocks after it ran away from the school, Hughan said. A Department of Fish and Wildlife game warden then shot it with a tranquilizer gun in front of a house, he added.
After the mountain lion was subdued, the Department of Fish and Wildlife tweeted to its followers that it was "asleep and safe."
The mountain lion was then taken to a "suitable habitat" in the Santa Susana Mountains, Hughan said, but would not elaborate on the exact location for fear that citizens may go looking for it.
"Everyone worked together," Hughan said. "It was the best possible outcome for the animal."