Broward County Sheriff Scott Israel identified the gunman as Nikolas Cruz, 19, a former student at Marjory Stoneman Douglas High School in Parkland who had been expelled for "disciplinary reasons," but was currently enrolled in Broward County Public Schools.
Cruz, whose fellow students described him as "troubled," was arrested without incident in the nearby town of Coral Springs after the Valentine's Day rampage and taken to hospital with minor injuries, the sheriff said.
Both students and adults had been killed, 12 of whom have now been identified, sheriff said.
He said at least 14 were taken to hospital and two had died there of their wounds. He added one of those killed was a football coach, and one student injured was a deputy sheriff's son.
"This is a terrible day for Parkland," Israel said, speaking of the city of about 30,000 people, located 50 miles (80 kilometers) north of Miami.
A teacher at the school said Cruz had been identified previously as a potential threat to his classmates.
"We were told last year that he wasn't allowed on campus with a backpack on him," math teacher Jim Gard said in a Miami Herald interview.
"There were problems with him last year threatening students, and I guess he was asked to leave campus."
Cruz was also said to have been in the Junior ROTC (Reserve Officers' Training Corps) program while at school.