The violence erupted at Marjory Stoneman Douglas High School in Parkland, about 72 kilometres north of Miami.
Live television footage showed students streaming out of the building as dozens of police and emergency services personnel swarmed the area.
The gunman was identified as Nikolas Cruz, who previously attended the school and was expelled for unspecified disciplinary reasons, Broward County Sheriff Scott Israel said.
“It’s a horrific situation,” Broward County Schools Superintendent Robert Runcie told reporters separately.
The gunman surrendered to police without a struggle, Israel said.
“It’s catastrophic,” he said. “There really are no words.”
Twelve of the dead were killed inside the school building, two others just outside, one more on the street and two other victims died of their injuries at a hospital, Israel said.
He said the victims comprised a mixture of students and adults.
“There was a time when he did attend the school,” Israel said. “I don’t know why he left, I don’t know when he left.”
It was the 18th shooting in a US school so far this year, according to gun control group Everytown for Gun Safety.
Staff and students told local media that a fire alarm went off around the time the shooting started, sparking chaos as some 3000 students at the school first headed into hallways before teachers herded them back into classrooms, to seek shelter in closets.
Kyle Yeoward, a 16-year-old junior, said he was in the bathroom on the second floor of the building on the campus where most of the shooting took place, when he heard two shots.
“He let loose on the freshman building,” Yeoward said
McKenzie Hartley, 19, who identified herself as the sister of a student at the school described the scene in a text message: “She heard him shooting through the windows of classrooms and two students were shot.”
Panicked parents checked on their children.
“It is just absolutely horrifying. I can’t believe this is happening,” Lissette Rozenblat, whose daughter goes to the school, told CNN.
Her daughter called her to say she was safe but the student also told her mother she heard the cries of a person who was shot.
“She was very nervous. She said that she could hear the person who was shot crying out for help,” she said.
Televised images showed dozens of students, their arms in the air, weaving their way between law enforcement officers with heavy weapons and helmets, and large numbers of emergency vehicles including police cars, ambulances and fire trucks.
The school had recently held a meeting to discuss what to do in such an attack, Ryan Gott, a 15-year-old freshman told CNN.
“My prayers and condolences to the families of the victims of the terrible Florida shooting,” U.S. President Donald Trump said on Twitter.
“No child, teacher or anyone else should ever feel unsafe in an American school.
Make your contribution to independent news
A donation of any size to InDaily goes directly to helping our journalists uncover the facts. South Australia needs more than one voice to guide it forward, and we’d truly appreciate your contribution. Please click below to donate to InDaily.