Sheriff Scott Israel says as 19-year-old shooter Nikolas Cruz moved through the school, he fired into five classrooms , four on the first floor and one on the second floor.
The teenager accused of using a semi-automatic rifle to kill 17 people at a Florida high school confessed to carrying out one of the nation's deadliest school shootings and carried extra ammunition in his backpack, according to a sheriff's department report released on Thursday.
Nikolas Cruz told investigators that he shot students in the hallways and on the grounds of Marjory Stoneman Douglas High School in Parkland, north of Miami, the report from the Broward County Sheriff's Office said.
Cruz said he brought more loaded magazines to the school and kept them in his backpack until he got to campus.
As the gunman moved through the school, he fired into five classrooms - four on the first floor and one on the second floor, Sheriff Scott Israel said.
The shooting lasted for three minutes. The assailant then went to the third floor and dropped his AR-15 rifle and backpack before running out of the building, attempting to blend in with fleeing students, Israel said.
After the rampage, the suspect headed to a Wal-Mart and bought a drink at a Subway restaurant before walking to a McDonald's. He was taken into custody about 40 minutes after leaving the McDonald's, the sheriff said.
TRT World's Steve Mort has details on the background of Cruz.
"One to shoot up the school"
A day after the attack, a fuller portrait emerged of the shooter, a loner who had worked at a dollar store, joined the school's US Military's Reserve Officer Training Corps programme and posted photos of weapons on Instagram. At least one student said classmates joked that Cruz would "be the one to shoot up the school."
The 19-year-old orphan whose mother died last year was charged with murder on Thursday in the assault that devastated the sleepy community on the edge of the Everglades.
It was the nation's deadliest school attack since a gunman targeted an elementary school in Newtown, Connecticut, more than five years ago.
"Blood was everywhere"
Students struggled to describe the violence that ripped through their classrooms just before the school day ended.
Catarina Linden, a 16-year-old sophomore, said she was in an advanced math class Wednesday when the gunfire began.
"He shot the girl next to me," she said, adding that when she finally was able to leave the classroom, the air was foggy with gun smoke.
"I stepped on so many shell casings. There were bodies on the ground, and there was blood everywhere."
State Senator Bill Galvano visited the high school on Thursday and was allowed to go up to the third floor, where he was shown bullet holes that marked where Cruz had tried to shoot out the windows at point-blank range. But the high-impact glass did not shatter.
Authorities told Galvano that Cruz apparently wanted to shoot out the windows so he could fire on the students running away from the school. Police told Galvano that it was not that difficult to open the windows.
"Thank God he didn't," Galvano said.
No specific motive yet
Among the dead were a football coach who also worked as a security guard, a senior who planned to attend Lynn University and an athletic director who was active in his Roman Catholic church.
The last of the bodies were removed from the high school on Thursday after authorities analysed the crime scene. Thirteen wounded survivors were still hospitalised, including two in critical condition.
Authorities have not offered any specific motive, except to say that Cruz had been kicked out of the high school, which has about 3,000 students and serves an affluent suburb where the median home price is nearly $600,000.
Students who knew him described a volatile teenager whose strange behaviour had caused others to end friendships with him.
17th incident of the year
Cruz was ordered held without bond at a brief court hearing. He wore an orange jumpsuit with his hands cuffed at his waist.
His attorney had her arm around Cruz during the short appearance. Afterward, she called him a "broken human being."
He was being held under a suicide watch, Executive Chief Public Defender Gordon Weekes told reporters.
Wednesday's shooting was the 17th incident of gunfire at an American school this year.
Of the 17 incidents, one involved a suicide, two involved active shooters who killed students, two involved people killed in arguments and three involved people who were shot but survived. Nine involved no injuries at all.
Trump avoids mention of guns
As the criminal case began to take shape, President Donald Trump, in an address to the nation, promised to "tackle the difficult issue of mental health," but avoided any mention of guns.
Trump, who owns a private club in Palm Beach, about 40 miles from Parkland, said he planned to visit the grieving community.
He did not answer questions about guns as he left the room.
Trump, who did not speak publicly immediately after the shooting, weighed in on Twitter on Thursday, calling the suspect "mentally disturbed" and stressing that it was important to "report such instances to authorities, again and again!"
So many signs that the Florida shooter was mentally disturbed, even expelled from school for bad and erratic behavior. Neighbors and classmates knew he was a big problem. Must always report such instances to authorities, again and again!— Donald J. Trump (@realDonaldTrump) February 15, 2018
In the case of Cruz, at least one person did report him.
Shocking YouTube comment
FBI agent Rob Lasky said the FBI investigated a 2017 YouTube comment that said "I'm going to be a professional school shooter."
But the agency could not identify the person who made the comment, which was from an account using the name Nikolas Cruz. It was left on a YouTube video of a vlogger and bail bondsman from Louisiana named Ben Bennight.
In a Buzzfeed article , Bennight said he called the FBI, and agents came out to talk with him. They called him again on Wednesday.
Officials were also investigating whether authorities missed other warning signs about Cruz's potentially violent nature.
He had been expelled from the school for "disciplinary reasons," according to the sheriff, who said he did not know the specifics.
Seen as potential threat
One student said Cruz had been abusive to his ex-girlfriend and that his expulsion was over a fight with her new boyfriend.
Math teacher Jim Gard told the Miami Herald that Cruz may have been identified as a potential threat before Wednesday's attack.
Gard believes the school had sent out an email warning teachers that Cruz should not be allowed on campus with a backpack.
The leader of a white nationalist militia called the Republic of Florida said Cruz was a member of his group and had participated in exercises in Tallahassee.
Jordan Jereb said he had only a brief interaction with Cruz a few years ago. The group wants Florida to become its own white ethno-state.
Neither the Leon County Sheriff's Office in Tallahassee nor the Southern Poverty Law Center could confirm any link between Cruz and the militia.
Jereb appeared to back away from his claim later on Thursday. Someone posting under his name on Gab, a social media site popular with far-right extremists, complained about getting criticised over a "prank," claimed there was a "misunderstanding" and said he received "a bunch of conflicting information."
Cruz's mother, Lynda Cruz, died of pneumonia November 1, and his father died previously, according to the arrest affidavit.
Two federal law enforcement officials said the gun - a Smith & Wesson M&P 15.223 - was purchased legally last year at Sunrise Tactical Gear in Florida.