Teachers at Inverlochy Primary School in Fort William implemented the procedure after reports concerning the behaviour of a man in the town centre reached police.
The BBC reported that the measure was lifted after the incident was resolved by officers from Police Scotland, who have since confirmed the nature of the operation.
Inspector Mike Middlehurst said: “We received numerous reports from members of the public about the behaviour of a man near the centre of Fort William.
“I can confirm that the man has now been arrested and is in police custody.
“An item was recovered from the man which has since been confirmed as being a toy gun.
“Nobody was injured during the incident.
“We are grateful to the members of the public who contacted us for their vigilance.”