Thousands of University of Minnesota students were told to take shelter Monday afternoon after a man reportedly armed with a gun tried to rob a student in Anderson Hall and then fled into the tunnel ­system between buildings.

Although the alert was advisory and students weren’t prohibited from moving around campus, multiple text alerts from university officials flew around social media sites. For nearly an hour police searched for the gunman, before declaring an all-clear for the campus. No arrests were made.

The attempted robbery is the latest in a string of violent crimes, including several robberies and assaults that took place off campus in recent weeks.

A woman told police on Monday that she was walking down a hallway inside Anderson Hall when a man approached her, showed her the gun and demanded her laptop. She handed him an empty bag. He got mad; she screamed. Police said the gun was not fired.

The U sent a text alert at 3:20 warning students and others on the Twin Cities campus to seek shelter, reporting that a person armed with a gun was seen at Anderson Hall, a building on the U’s West Bank and just south of the Washington Avenue Bridge, according the University News Service.

About 45 minutes later, police sent an update, saying the search of the West Bank was complete and that there was no need to take ­shelter. “This was an attempted robbery — no shooting occurred,” police said.

Some students said they weren’t surprised by the latest outbreak of violent crime on campus.

The police issued a crime alert Nov. 1 after three separate off-campus robberies on the night of Halloween. “The robberies continue a trend that shows a rise in the number of crimes close to campus and an escalation in the bold and violent nature of the criminals,” the alert warned.

The criminals appear to be coming to campus with the intention of targeting students, the alert warned. University police arrested three people thought to be responsible for a Nov. 1 assault and robbery that left one female victim with a broken nose, according to the alert.

Minneapolis police also have sent extra patrols to the area around the Minneapolis campus to assist with ongoing investigations, university police reported.

Hallway robbery

A scream and a loud thump on Monday afternoon drew Daren Johnson, technical project manager for the Information Technology Office in the College of Liberal Arts, out from his locked office and into the hall. There he found a woman who was shaken but unhurt.

“She said there was a man with a gun so I got her to a place that was safe, and we called the police,” Johnson said. “We kept her safe, got her water.” Johnson and his colleagues work in a string of offices on the ground floor of Anderson Hall.

Nearly an hour after the incident, Johnson said he wasn’t particularly nervous about encountering the ­gunman.

“I’m assuming this guy is probably long gone from this building,” Johnson said. “If there’s anywhere on campus that’s safe, I’m safe right now. Why would he come back here where he was seen and identified? Other people might be a little worried. Although every time I walk out my door I’m glancing right and then left to make sure things are clear.”

Some classrooms were emptied: “I don’t know … people are freaking out a bit,” said Andrew Njuguna, whose chemistry class was emptied at 3:40 p.m. due to the threat.

Freshman Jake Herges said he got the text alert about a gunman on the West Bank and decided to go see what was happening.

“My friends said, ‘No, no, no,’ ” he said, standing outside Anderson Hall. “So I’m out here right now and there’s kids walking to class, so maybe no big deal?”

The nearby Cedar-Riverside area also got word. Upon receiving reports of the gunman, an employee of Mapps coffee shop went around telling patrons the news and locked the doors.

Campus police said they were searching for a man with a gun, describing him as a black male, 20 years old, 6 feet tall and wearing a black, puffy hooded jacket.

Over on the East Bank, students were evacuated from the Mechanical Engineering Building about 4:30 p.m. while firefighters checked for a possible gas leak. Graduate students reported hearing a “hissing sound” but a check of the building found no leak, said Brooke Dillon from the University News Service. The incident wasn’t connected to the alert on the West Bank.