A Mandurah student has been caught with a gun at school, after apparently showing off the weapon to friends.

Police were called out to Halls Head Community College around 2.30pm on Tuesday after the firearm was seized by teachers at the school.

Police attended the Casuarina Drive property and seized the airsoft rifle.

According to police, “the rifle is not capable of being licensed and fires plastic ball pellets”.

The school says the weapon was not used to threaten, harm or put other students in danger.

The 15-year-old student, who is from Falcon, is assisting police in the investigation.