An 11-year-old boy armed with two guns — and possibly inspired by a violent video game — fatally shot his teacher and wounded at least six others before killing himself at his northern Mexico elementary school Friday morning, authorities said.

The sixth-grader killed a female teacher inside the private Colegio Cervantes de Torreón elementary school in the city of Torreón in the state of Coahuila, Torreón Mayor Jorge Zermeño Infante told reporters.

At least five students were injured — one seriously — and another teacher was also wounded, authorities said.

The boy was apparently influenced by the first-person shooter game “Natural Selection” — perhaps even trying to recreate it, according to Miguel Riquelme, Coahuila’s governor.

The boy wore a shirt emblazoned with the name of the game during the attack, Riquelme said.

The child, who lost his mother years ago, never had problems at the school, the governor said.

“He was well-behaved, but he told some of his classmates that ‘today was the day,’ ” he said. “And what we can observe is that the boy was influenced by a video game.”

The student apparently opened fire with both weapons after he failed to return from the bathroom after 15 minutes and his teacher went to look for him, according to Riquelme.

Zermeno told the TV network Televisa that the boy, who lived with his grandmother, had “very good grades” but “almost certainly had some kind of [psychological] problem.

“It’s a tragedy,” Zermeno said. “It’s very, very sad that a boy of 11 can come to school with two guns.”

With Post wires