A student at an elementary school in the northern Mexican city of Torreon shot and killed a teacher Friday and wounded five other pupils, and then apparently killed himself, authorities said.

Police are still investigating but believe the boy was between eight and 10 years old, said Lieutenant Adelaido Flores, as panicked parents gathered outside the Cervantes elementary school and officials evacuated the building.

The student was in his final year of elementary school, Torreon Mayor Jorge Zermeno told TV network Televisa.

"The boy lived with his grandmother. He almost certainly had some kind of (psychological) problem, although he had very good grades," Zermeno said.

The wounded were being treated at a local hospital, two of them in serious condition, he added.

Mexico is more used to seeing school shootings from afar -- often in the neighboring United States -- than up close, though in 2017 a 15-year-old shot and wounded four classmates at a high school in the northern city of Monterrey.