A student with a stun gun caused a stir in a lecture at the Ludwig-Maximilians-Universität (LMU) on Tuesday.

A fellow student saw the 18-year-old's gun and alerted the police, said a spokesman for police headquarters.

The investigators came in large numbers and arrested the man, but soon gave the all-clear.

The 18-year-old has a gun license and has not threatened or endangered anyone, it said.

According to the police, the student is now free again.

The spokesman said he was entitled to at least carry the weapon concealed.

The reason given by the 18-year-old was anxiety.

The press spokesman explained the man's motivation: he simply feels safer if he carries the gun with him.

According to the police, he has not made himself a criminal offence.

However, he may have violated university regulations prohibiting the carrying of weapons in the building.

That is currently still open, said the police spokesman.

In the case of alarm guns, no projectiles are fired, but cartridges with oxyhydrogen or tear gas.

According to the police, it cannot be used to kill.

However, if handled improperly, serious injuries are possible.