Note to 30 Cupertino High School students: Um, bringing those Nerf guns to school wasn’t such a good idea.

Cupertino High was locked down for 20 minutes Monday morning when a custodian spotted the handle of an Uzi-style plastic gun sticking out of a gray backpack of a student crouched behind a car.

Santa Clara County sheriff’s Sgt. Jose Cardoza said deputies responded to the 8:24 a.m. Code Red call.

In minutes, deputies reached the campus known for its stellar SAT scores. Cardoza said the boy was apprehended, but it was quickly revealed that he was one of about 30 students, mostly seniors, some of whom brought in Nerf guns to play a game called Assassin.

None of the students were arrested or cited, and the sheriff’s office turned Nerf-Gate over to the school.

Principal Kami Tomberlain said several Nerf guns have been confiscated.

Tomberlain and Cardoza both said the school acted appropriately.

“We didn’t call 911 because someone saw a toy gun,” she said. “We called 911 because we thought we had an active shooter on campus. The handle of the gun looked quite real.”

Cardoza said criminals also have been known to paint their real guns with whimsical colors to throw off police. He added that the custodian “did the right thing” in erring on the side of caution.

Tomberlain spent the morning alerting all parents of the lockdown, interviewing the more than two dozen boys and girls who brought in the toy guns, and then calling their parents to let them know that their children are now facing school consequences.

She added that a few years back, students had asked to play Assassin, where players try to eliminate each other by using mock weapons to be the sole survivor of the game. But the administration has said no. “These kids didn’t think to ask this year,” she said.

As for the students, punishments will be doled out, though Tomberlain declined to elaborate.

“These students should have known better,” she said. “We have zero tolerance for weapons at school, real or replicas. These kids know this, they just weren’t thinking this all the way through.”

Contact Lisa Fernandez at 408-920-5002.