Dennis Alexander, a teacher at Seaside High School in Monterey County and a reserve police officer, fired the semiautomatic handgun as it was pointed at the ceiling, police chief Abdul Pridgen said in a statement.

Pridgen said no one was hit by gunfire or seriously hurt and police registered one injury, although local media reported that three teenagers were struck by debris falling from the ceiling.

"One student had an abrasion to his neck, a red mark. When the bullet stroked the ceiling some debris came down. We didn't confirm two others," Seaside police commander Judy Veloz told AFP.

"There was no panic in the school. The teacher has been put on administrative leave. We're still investigating, interviewing students. The school is open as usual."

Mr Alexander excused himself following the incident, but class continued, according to CNN.

Fermin Gonzales, the father of the 17-year-old boy to whom police were referring, told NBC affiliate KSBW Alexander had informed the class he was going to demonstrate how to disarm someone and was checking if the weapon was loaded.

"It's the craziest thing," said Gonzales, who added that bruising to his son's neck appeared to have been caused by a bullet fragment.

Alexander, who also teaches math, has been placed on leave both as a teacher and in his position as a reserve officer for the Sand City Police Department. He could not immediately be reached for comment.

The massacre of 17 students and staff in Parkland, Florida, last month has ignited a nationwide debate over whether some teachers should be armed, with President Donald Trump and Education Secretary Betsy DeVos in favour.

Students across the United States walked out of classes on Wednesday in a nationwide call for action against gun violence, many gathering outside the White House and chanting "Never again!" and "Enough is enough!"

Concealed carry at colleges and schools has been banned since 2015 in California and police are understood to be establishing whether Alexander violated any regulations by bringing a gun onto campus.

"I think a lot of questions on parents' minds are, why a teacher would be pointing a loaded firearm at the ceiling in front of students," Superintendent PK Diffenbaugh told CNN affiliate KSBW.

"Clearly in this incident protocols were not followed."