State 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 school of about 900 students was cordoned off as authorities cleared the buildings and teens were taken to another location.
WATCH ABOVE: Parents, students react after 3 people killed in school shooting in New Mexico
A crowd of nervous parents gathered outside City Hall to wait for more information as officers tried to reassure them about the safety of their children.
“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.
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.
WATCH: Past video coverage of school shootings
“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.