A law enforcement official says the gunman in Tallahassee who shot three people at Florida State University early Thursday before being killed by police was a lawyer who graduated from the school.

The official told The Associated Press that the shooter was Myron May, who graduated from Florida State before attending Texas Tech University's law school. The official requested anonymity, because he was not authorized to release the name.

May was fatally shot after he shot three people at the Florida State library. Two are hospitalized and one has been released.

Police investigate a shooting at Strozier Library on Florida State campus on Thursday, in Tallahassee, Fla. (Steve Cannon/The Associated Press)

Abigail Taunton told the AP that May had recently been staying at a guest house she owns in a rural area in the Florida Panhandle. She said police interviewed her husband, David, after the shooting.

A gunman opened fire early Thursday at a Florida State University library, sending hundreds of students who had been up all night studying for exams scrambling for cover in the book aisles and barricading themselves in with desks.

Three students were wounded before police killed the gunman in a shootout, authorities said.

Police and FSU officials called the shooting an "isolated incident," but have not released many details, including how far the suspected gunman made it into Strozier Library. FSU's compact campus is located less than a mile from downtown Tallahassee and the state Capitol.

Tallahassee police investigate a shooting outside the library on the Florida State University campus on Thursday. (Mark Wallheiser/The Associated Press)

"This person just for whatever reason produced a handgun and then began shooting students in the library," FSU Police Chief David Perry said.

The attack started soon after midnight when students inside the multistory library heard about half a dozen gunshots. Students began screaming that someone was shooting at them and flipped over chairs in their race to take cover.

"I ran for my life," said Allison Kope, a freshman from Cocoa Beach, who was on the library's first floor.

"I ran right out the backdoor. My laptop and everything is still in there. It was shock. It was just instinct. You don't think about anything else, you just go."

Other students hid in the book aisles and some barricaded themselves in rooms.

Sarah Evans, a senior from Miami, said she was inside the library and heard a male student say he had been shot. When she looked at him, he was on the ground with blood spreading on his pants leg.

Two of the victims were taken to a local hospital. FSU officials said a third student was only grazed by a bullet and was treated at the scene and released.

Tallahassee and Florida State University police confronted the gunman just outside the library that sits in the middle of the campus and ordered him to drop his handgun, but he fired a shot at them and they unleashed a volley of shots, Tallahassee Police spokesman Dave Northway said.

Hours after the shooting, detectives could be seen inspecting the body of the suspected gunman, who was lying face down at the top of an access ramp just outside the library. A grey baseball cap lay near his head.

The shooting prompted a campus alert that urged students to take shelter and stay away from doors and windows. After the shooting, FSU officials announced classes would be cancelled for Thursday.

'I thought he was joking'

Daniel Morales, a 19-year-old freshman from Fort Pierce who was in the library during the attack, said that when he first heard someone say "somebody's got a gun. I thought he was joking." But after realizing there was a gunman in the library, Morales and others raced to a back room on the second floor where they barricaded a door with desks.

Freshman Nikolai Hernandez said he was in his dorm room across from the library when he heard five or six rapid gunshots.

"It was a consecutive bop, bop, bop, bop, bop," Hernandez said. "It makes me definitely a little bit nervous. I was supposed to be in the library. I had a paper to do and I got a little bit lazy and decided not to do it."

Florida State President John Thrasher, who took office earlier this month, said by phone that he was in New York City at the time of the shooting. He said he was scheduled to return to Tallahassee later Thursday.