The 911 call made by a UCF student and roommate of gunman James Oliver Seevakumaran helped thwart a mass shooting at the Orlando university, campus police said.

Arabo Babakhani, Seevakumaran’s roommate, slammed the bathroom door and called 911 when Seevakumaran pulled a gun on him early Monday morning. The gunman eventually killed himself, but authorities found an assault weapon and improvised explosive devices in his dorm room. The discovery of the weapon led police to believe he was planning an attack on the University of Central Florida campus.

"As he was like raising the gun, he didn't get it all the way up, as he was raising the gun I slammed the door on him before he could pop anything off," Babakhani told Knightly News, the UCF student newspaper. “I got away from the door in case he barred into it. I crouched in front of my chair in case he fired into the door. I crouched in front of my chest of draws in case he fired into a wall.”

Babakhani described Seevakumaran as a loner.

“I don’t know if he’s got any family. I’ve never heard him talk on his cell phone or I don’t know if he’s got any family. I don’t know if he’s got any friends [because] I’ve never seen them,” he told the newspaper.

At around the same time campus police received the UCF student’s 911 call, they also received notice that the fire alarm had been pulled in the Tower 1 dorm.

Campus police said it was Seevakumaran who pulled the fire alarm, and they said the act was part of a plan to flush students out of the dorm so he could shoot them and throw the bombs at them, according to ABC News.

Campus police responded to the dorm three minutes after the 911 call and fire alarm was pulled.

"His timeline got off," UCF Campus Police Chief Richard Beary told FOX News. "We think the rapid response of law enforcement may have changed his ability to think quickly on his feet."

The incident prompted UCF to cancel classes until 12 p.m. Monday. The Tower 1 dorm was also evacuated.

An investigation into the incident yielded clues that Seevakumaran was planning to shoot UCF students, ABC News reported.

"Anybody armed with this type of weapon could have hurt a lot of people there, particularly in a crowded area as people were evacuating,” Beary said, referring to the bombs and assault weapon. "It could have been a very bad day."