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 Thursday.
Nikolas Cruz took an Uber to the school, where 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 the 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 the backpack and ran 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.
WATCH: Takedown of Stoneman Douglas HS suspect
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 ROTC program 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 Thursday in the assault that devastated this 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.
Meanwhile, 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."
PARKLAND, Fla. — Photos: Remembering Parkland Florida school shooting victims
State Sen. Bill Galvano visited the high school 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.
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 Thursday after authorities analyzed the crime scene. Thirteen wounded survivors were still hospitalized, including two in critical condition.
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.
WATCH: Who Is Nikolas Cruz, Alleged Gunman In Florida School Shooting?
Cox Media Group