Police did not release any details about the shooter but confirmed the other two people who were killed attended Aztec High School. No other injuries were reported, officials said.
"The families of the victims were notified immediately. They are in our thoughts and prayers," state police said in a statement on social media.
State and federal authorities are investigating what led to the shooting and did not immediately release any details about the circumstances. A news conference was planned.
Stay on top of breaking news stories with the ABC11 News App
The school of about 900 students was cordoned off as authorities cleared the campus and teens were taken to another location.
A crowd of nervous parents gathered outside City Hall in the moments after the shooting to wait for more information as officers tried to reassure them about the safety of their children.
Despite the closure of all schools in Aztec, authorities said there were no other credible threats to students at the high school or other schools in the neighboring communities of Bloomfield or Farmington.
Aztec is a rural community of 6,500 people in the heart of northwestern New Mexico's oil and gas country and near the Navajo Nation. Its main street is lined by old brick buildings that date back more than a century.
Residents voiced disbelief on social media, while members of the New Mexico congressional delegation, state Attorney General Hector Balderas, and other elected officials offered their condolences and other assistance.
"While details are still coming in, we grieve for the innocent victims in this senseless act of violence. Too many lives have been disrupted and too many futures cut short," U.S. Rep. Ben Ray Lujan said in a tweet.