A man with a gun on the UC Irvine campus called police Tuesday to tell them where he was, officials said, but not before officials locked down the school, including the theater in which the new chancellor was being officially installed.

University officials said at about 3:15 p.m. that police had located the man, who was armed.

“He had a gun, I don’t know what kind,” campus spokeswoman Cathy Lawhon said.

About 30 minutes earlier, police sent an alert saying a man with a gun was spotted near UCI’s main flagpole, headed toward the Mesa Court student housing area. Students were told to shelter in place.

Police had not arrested the man as of 4 p.m. but were interviewing him, trying to find out why he’d brought the gun to UCI, Lawhon said.

He had the proper permits to carry the weapon, but the campus has a policy barring firearms from the property, according to Lawhon.

She did not know if it was a crime for the man to have brought the gun to the university.

Police did not immediately release any information about the man’s identity or affiliation with UCI.

A ceremony inducting UCI’s new chancellor, Howard Gillman, was scheduled to begin around the time police sent their alert.

The ceremony continued at the Barclay Theatre, with the doors locked and nobody allowed in or out.

Earlier this month, a “viable threat of violence” prompted the university to cancel a student government meeting where student legislators had planned to discuss overriding the veto of a controversial measure that would have banned the U.S. flag — and all other flags — from a small area of the campus.

Less than two years ago, UCI police quickly took another gunman into custody after a student spotted him near the Ayala Science Library and called 911.

Student Manas Moole Reddy was hiding the revolver, loaded with six shots, when police arrested him within 12 minutes of the call, campus officials said at the time.

Reddy was sentenced to 40 days in jail and three years’ probation after pleading guilty to carrying the weapon on campus.

Police said then that they were moments from sending out a campus-wide notification when they located Reddy.

— Daily Pilot staff writers Hannah Fry and Nicole Knight Shine contributed to this report.