The student entered Arapahoe High School in a Denver suburb around midday brandishing the gun. He asked fellow students about the location of the teacher, then shot a 15-year-old girl who was nearby, said Arapahoe County Sheriff Grayson Robinson.
The targeted teacher immediately fled the school and was not injured, while the gunman was later found inside a classroom, dead of an apparently self-inflicted gunshot wound, Robinson said. The incident was over in 14 minutes.
"I believe the shooter knew that deputy sheriffs were immediately about to engage him, and I believe that shooter took his life because he knew that he had been found," the sheriff told a news conference.
He later named the gunman as 18-year-old Karl Pierson, who was enrolled at the school.
The rampage in the Denver suburb of Centennial took place just 8 miles (13 km) from the scene of one of the deadliest school massacres in U.S. history, Columbine High School, where two students gunned down 13 classmates and staff before killing themselves in 1999.
Robinson said there was no sign the incident was related to the anniversary on Saturday of last year's shooting at an elementary school in Newtown, Connecticut, in which a gunman massacred 20 children and six adults before killing himself.
Holly Schaefer, an 18-year-old senior at Arapahoe High School, said she was in mathematics class when she and fellow students heard a loud bang. That was followed shortly by another bang and "then we knew definitely it was a gunshot."
Schaefer said her teacher immediately locked the door to the classroom as students huddled in a corner of the room.
After about 30 minutes, Schaefer said, they heard police calling out on the other side of the door. Officers eventually cleared the classroom and as students were being escorted out of the building, she said she saw blood on the hallway floor.