A UC Irvine student brought a loaded gun onto campus Monday and was clutching it close to his chest when another student spotted the weapon, a campus representative said.

Within 12 minutes of the reported sighting, police had taken Manas Moole Reddy of Irvine into custody not far from the Ayala Science Library, according to UCI spokeswoman Cathy Lawhon.

On Wednesday, the Orange County district attorney charged Reddy, 28, with one felony count each of possession of a loaded firearm on a college campus, unlawful possession of a firearm and possession of ammunition by a prohibited person.

He had been hiding the revolver, loaded with six shots, while he stood in a parking lot near the science library about 3 p.m. Monday, according to the district attorney and Lawhon.

Reddy used his left hand to hold the handgun inside an open shoulder bag that he had strapped across his chest when a female student caught a glimpse of the firearm, according to the district attorney.

When Reddy realized the gun was spotted, he ran, and the female student called police, according to Lawhon.

UCI Police Department officers immediately responded, established a perimeter and began searching for the gun-toter, Lawhon said.

She said UCI Police Chief Paul Henisey had his finger “inches from the button” to send out a campuswide alert on the alleged gunman when officers found him.

Officials have not indicated what Reddy intended to do with the revolver. Police will try to determine that as their investigation continues, Lawhon said.

Reddy would face a maximum of four years in state prison if convicted and is in custody on $100,000 bail, according to the district attorney.

Police have also barred Reddy from campus, Lawhon said.

The student who reported the gun asked campus officials to protect her identity, but UCI’s spokeswoman praised her.

“The student who made the report … deserves huge thanks and credit for quick thinking,” Lawhon said. “She’s to be commended.”