State officials fired Omar Mateen from the Martin Correctional Institution after he suggested to a college classmate that he was going to bring a gun to school and regularly fell asleep during classes, according to records released Friday.

Mateen lasted about six months as a trainee at the prison in Indiantown before he was dismissed in 2007. At the same time, he was enrolled in criminal justice courses at Indian River Community College nearby.

In April of that year, a classmate reported that Mateen asked him if he would "tell anyone" if Mateen brought a gun to the campus. The classmate reported the incident a week after a gunman killed 32 people on the campus of Virginia Tech.

"In light of tragic events at Virginia Tech," wrote the prison warden, P.H. Skipper, "officer Mateen's inquiry about bringing a weapon to class is at best extremely disturbing."

The episode followed a series of slipups at the community college, where Mateen skipped classes, snored during lessons and dozed off at the shooting range. After he was fired, Mateen did not earn a law enforcement certificate and went to work as a private security guard.

Hired by a private company, G4S, he was licensed to carry a gun on duty and worked at the St. Lucie County Courthouse before he was transferred because of an unknown "incident" involving a black coworker, a former colleague said. Mateen wound up manning the guardhouse of a gated community.

At the guardhouse, Mateen had a violent temper and was openly homophobic and racist, said former coworker Daniel Gilroy. Gilroy said he complained to G4S about Mateen's behavior.

The company denied this and state records show no complaints against his security license.