Police said it happened during a computer lab class at E.O. Green School in Oxnard.
Prosecutors said McInerney is also charged with a hate crime because of his alleged white supremacist views, and because his classmate King, had said he was gay.
The now 17-year-old McInerney could face life in prison if convicted.