You are not permitted to download, save or email this image. Visit image gallery to purchase the image.
One of those wounded was a teacher and the remainder were pupils at Oxford High School in Oxford, Michigan, about 65km north of Detroit, the Oakland County Sheriff's office said.
The motive of the shooter was unknown, officials said.
Those killed were a 16-year-old boy, a 17-year-old girl and a 14-year-old girl, Undersheriff Michael McCabe told reporters at the scene.
Two of the wounded were in surgery and six were in stable condition, McCabe said.
The suspect, a sophomore at the school, was believed to have acted alone and was arrested without resistance after firing 15 to 20 shots, McCabe said.
"The whole thing lasted five minutes," McCabe said.
The suspect divulged nothing to police and demanded his right to a lawyer upon being advised not to speak by his parents, McCabe said.
The latest in a rash of US school shootings will likely fuel debates about gun control and mental health care, with many states allowing easy access to firearms while mental health disorders frequently go untreated.
"This is a uniquely American problem that we need to address," said Michigan Governor Gretchen Whitmer, who rushed to the scene and appeared with McCabe before the media.
But Whitmer, a Democrat who has been harshly criticized by right-wing militias and pro-gun advocates, also told reporters it was inappropriate to discuss specific policies at the scene.
"At this point I think we need to focus on the tragedy at hand here," she said.
Pupils Abbey Hodder told the Detroit Free Press she was in chemistry class when she heard the sound of glass breaking.
"My teacher kind of ran out and was scrambling," Hodder (15) told the newspaper. "The next thing I knew I saw he was pushing tables. It's part of school protocol to barricade, so we all knew, barricade, barricade down. And we all started pushing tables."
McCabe praised the school for its preparation for a shooting and an orderly evacuation.
President Joe Biden was told of the shooting by National Security Adviser Jake Sullivan in advance of a tour and remarks at a Minnesota technical college, Press Secretary Jan Psaki told reporters.
"My heart goes out to the families enduring the unimaginable grief of losing a loved one," Biden said from Minnesota.
McCabe downplayed reports that some pupils were forewarned of danger on social media, saying they were unconfirmed rumours.
"We are not aware of any warnings," McCabe said. "Please don't believe everything you see and hear on social media."