MIAMI (AFP) - Police have identified the gunman at Florida State University as alumnus Myron May, a lawyer who was described as "in a state of crisis".
May, 31, who graduated in 2005, became a lawyer in Texas and New Mexico before recently returning to Tallahassee.
Tallahassee police chief Michael DeLeo said May was "in a state of crisis" and that he had written journals and recorded videos in which he spoke of "being targeted" by the government.
Terror gripped the university in Florida on Thursday when May opened fire with a semi-automatic handgun, wounding three people before he was shot and killed by police.
The latest episode of America's epidemic of gun violence happened just after midnight at Florida State University.
Two of the wounded were students, while a third was a university employee. Earlier reports had stated that all three victims were students.
Up to 500 students were inside the university's Strozier Library, pulling all-nighters ahead of pre-Thanksgiving exams, when several shots rang out.
Many scrambled for cover, hiding between aisles of books and huddling in study rooms. One student got home to discover that a bullet to his back had been stopped by books in his backpack.
Police officers responding to 911 calls confronted the gunman outside the library. When he refused an order to put down his weapon, a .380 semi-automatic handgun, they opened fire.
At least 30 rounds were fired during the incident by both police and the gunman, DeLeo said.
Of the three people wounded, two were in hospital and one in critical condition, health care officials said. A third was treated at the scene.
With classes cancelled for the day at the 40,000-student institution, several dozen students knelt in prayer outside the library during a mid-day vigil.
"I want to encourage everybody to take time and process the tragedy," said Florida Governor Rick Scott, a Republican who in June enacted a raft of fresh pro-gun laws.
Florida State University president John Thrasher, in a statement, said investigators had assured him that the shooting was "an isolated incident." But it was the 23rd shooting at a US college this year in which at least one person was wounded or killed, according to a running tally by the Everytown for Gun Safety lobby.
With midterms scheduled before next Thursday's Thanksgiving holiday, the Strozier Library was open round-the-clock to accommodate students trying to cram for the exams.
Mr Jason Derfuss, 21, said he was exiting the library with a backpack full of books when he heard a loud shot being fired behind him.
Turning around, the humanities major saw the gunman fire two more shots at point-blank range and watched the victim "crumple to the ground", he told the local Democrat newspaper.
Only when he got home and opened his backpack did he discover a bullet slug that had gone right through one book, about the 14th century philosopher John Wyclif, and lodged in another.
"I assumed I wasn't a target... The truth is I was almost killed tonight and God intervened," Derfuss told his friends on his Facebook account.
Another student, Mr Sean Young, told local television channel WCTV he was on the third floor when students started frantically running past him, and someone said a gunman was downstairs.
With a fellow member of his fraternity, Mr Young crammed as many people as possible into a study break room, hoping they would all be safe inside.
"I just tried to remain calm, especially for those that were around me. I didn't want to panic anybody else. For me personally, it's still kind of registering," he said.
Second-year undergraduate John Ehab, also on the third floor, told WTXL television that students took cover in book aisles, fearing the gunman might come upstairs.
"It was a consecutive bop, bop, bop, bop, bop," added freshman Nikolai Hernandez, who was in his dorm room across from the library.
"It makes me definitely a little bit nervous," he told WTXL. "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."
Semi-automatic pistols of the type used by the gunman are easily available at US gun shops, selling for about US$500 (S$650) new.