The shooting at Berrendo Middle School in Roswell took place in a gym where students had gathered to stay warm from the frigid weather outside before the start of class, Governor Susana Martinez told reporters.
"The shooter was quickly stopped by one staff member who walked right up to him and asked him to set down the firearm, which he did," Martinez said.
The wounded students were taken to a local hospital, where they were stabilized. They were then flown by helicopter to University Medical Center in Lubbock, Texas, about 150 miles east of Roswell, because that facility has a Level 1 trauma center, said hospital spokesman Eric Finley.
The wounded children were an 11-year-old boy in critical condition and a 12-year-old girl in serious condition, and both underwent surgery for gunshot wounds, Finley said. Earlier reports had placed the boy as older, aged 12 or 14.
The shooting was the second to take place at a US middle school in three months, after a 12-year-old boy opened fire at his middle school in Sparks, Nevada, in October, killing a teacher and wounding two students before killing himself.
It comes amid a contentious national debate on gun control that intensified after a gunman shot dead 20 students and six staff members at Sandy Hook Elementary in Newtown, Connecticut, in December 2012. Following that attack, President Barack Obama called for sweeping new gun control measures.
Most of Obama's proposals were defeated in Congress, but his administration proposed new regulations this month aimed at clarifying restrictions on gun ownership for the mentally ill and bolstering a database used for firearms background checks.