(CNN)In a matter of minutes, thousands of students at Marjory Stoneman Douglas High School went from thinking they were part of a fire drill to hiding inside closets and bathrooms to escape gunfire.
What happened, moment by moment, in the Florida school massacre
Authorities say Nikolas Cruz allegedly opened fire inside the Florida school on Wednesday, killing at least 17 people, both adults and children.
This is how events unfolded in one of the 10 deadliest mass shootings in modern US history, according to law enforcement authorities, school officials and witnesses. All times are Eastern.
• Cruz takes an Uber car.
• Uber car drops Cruz at Marjory Stoneman Douglas High School in Parkland.
• A witness allegedly spots Cruz arriving in a goldish colored vehicle and alerts a colleague via radio that Cruz was "walking purposefully toward the 1200 building." Within a minute, he hears gunshots and reports a code red situation -- an active shooter.
• The suspect enters the school's east stairwell of building 12, with a rifle inside a black soft case. When he exits the stairwell, he pulls the rifle out of the case.
• He allegedly sets off the school's fire alarm, prompting the evacuation of some 3,000 students and staff. Investigators believe the suspect wanted to draw people out of classrooms to increase the number of casualties.
• The suspect begins shooting into four classrooms. He then takes another stairwell to the second floor and allegedly shoots one victim.
• The shooter uses a .223-caliber AR-15 firearm to carry out the massacre.
• He allegedly is wearing a gas mask and carrying smoke grenades. It's unclear whether the smoke grenades were used.
• As the school goes on lockdown, students take cover inside classrooms. Others jump over the fences and escape to take shelter in a nearby Walmart. Some students text their loved ones and others post on social media images of chairs overturned in classrooms and floors stained with blood.
• Twelve people are killed inside the building, two outside and one in the street. Two others die at the hospital.
• The gunman takes the building's east stairwell to the third floor, where he drops the rifle and backpack. Then, he runs down the stairs.
• The suspect exits building 12, runs toward the school's tennis courts.
• He continues running and eventually mixes in with the students and staff running out of the school.
• The alleged gunman arrives at a nearby Walmart store, buys a drink at a Subway there and walks out.
• The Broward County Sheriff's Office begins investigating reports of an active shooter at the school. When deputies arrive, they see hundreds of students fleeing.
• Suspect goes to a nearby McDonalds, where he sits down for a short time before he walks out.
• The FBI and dozens of police vehicles respond to the shooting.
• Video shows some students lying on the ground, being treated for injuries and moved into ambulances.
• White House press secretary Sarah Sanders says President Donald Trump was briefed on the incident and is monitoring the situation.
• The gunman is still at large.
• The school begins dismissing students. Buses take them to a hotel, where they reunite with their families.
• A Coconut Creek Police officer searching for the suspect in a nearby neighborhood notices that someone walking on the side of the road is wearing clothing matching the suspect's description. Details about the suspect had been transmitted via law enforcement radio.
• A witness who had seen Cruz arriving at the school prior to the shooting identifies him at the arrest location.
• Authorities had also identified the suspect using school security videos.
• The officer approaches the suspect and arrests him without incident.
• He is taken to the Broward Health North hospital because he has "labored breathing." Cruz is treated and released to police custody.
• President Trump tweets, "My prayers and condolences to the families of the victims of the terrible Florida shooting. No child, teacher or anyone else should ever feel unsafe in an American school."
• Law enforcement searches the school's buildings to evacuate students from classrooms.
• Broward County Public Schools Superintendent Robert Runcie says the school received no warnings and that he was not aware of any threats against the school.
• Gov. Rick Scott travels to Broward County to be briefed about the shooting.
• Authorities identify the alleged gunman as Nikolas Cruz -- a 19-year-old former student at the high school. He arrives at the Broward County Sheriff's Office wearing a hospital gown and is escorted inside by deputies.
6:30 p.m. to end of day
• Cruz tells police he was the gunman and says he discarded the firearm
• School district officials say the school will remain closed for the rest of the week.
• The FBI sets up a website for students and others who were inside the school to upload videos and photos of the shooting.
• Law enforcement officials search Cruz's home and another undisclosed location.
• Cruz, who is being held without bond, makes his first court appearance in Broward County via jail video. He said nothing except to confirm his name.
• Cruz is charged with 17 counts of premeditated murder in connection with the shooting.