James Oliver Seevakumaran, 30, was found dead in his dorm room at the 51,000-student Orlando campus of the University of Central Florida. No one else was hurt.
"His timeline got off," university Police Chief Richard Beary said. "We think the rapid response of law enforcement may have changed his ability to think quickly on his feet.
Some 500 students were evacuated from the building in the middle of the night, unaware how narrowly they had escaped what could have been another Virginia Tech-style bloodbath.
"It could have been a very bad day here for everybody. All things considered, I think we were very blessed here," Beary said. "Anybody armed with this type of weapon and ammunition could have hurt a lot of people here, particularly in a crowded area as people were evacuating."
Police shed no light on a motive, but university spokesman Grant Heston said that before the episode, the school was in the process of removing Seevakumaran from the dormitory because he hadn't enrolled for the current semester.
Detectives found notes and other writings that indicated Seevakumaran had carefully planned an attack and "laid out a timeline of where he was going to be and what he was going to do," Beary said.
The episode began early Monday, just after midnight, when Seevakumaran pulled a gun on one of his roommates, who holed up in a bathroom and called police, Beary said. Around the same time, Seevakumaran pulled a fire alarm, apparently to get other students out in the open, the police chief said.
In his room, investigators found four makeshift explosive devices in a backpack, a .45-caliber handgun, a .22-caliber tactical rifle, and a couple of hundred rounds of ammunition, police said. Beary said it appears his weapon and ammunition purchases began in February.
Antonio Whitehead, 21, said he heard the fire alarm go off in the dorm and thought it was a routine event.
"All of a sudden, I felt the crowd move a little faster. And a police officer with a machine gun or something told everyone to start moving a lot faster," he said.
Seevakumaran had attended the university from 2010 through the fall semester as a business student.
According to Florida records, his only adult arrest in the state was in 2006 for driving with a suspended license.
Morning classes were canceled, but most campus operations resumed around noon.
Associated Press writers Mike Schneider in Orlando and Freida Frisaro in Miami contributed to this report.
Follow Kyle Hightower on Twitter at http://www.twitter.com/khightower