A man lured two police officers to his flat with a bogus robbery claim before pulling a firearm on them.
The officers locked themselves in Robert Lambert’s Perth city centre flat out of fear they were about to be shot in the common close.
As they pressed their panic buttons, Lambert, 62, opened the letterbox and pointed the imitation firearm into the hallway.
It was not until they got a longer look at the weapon that the officers realised it was an imitation.
Lambert then led officers on a high-speed chase on the A9 Perth- Stirling road that came to an end when he ran out of fuel.
Lambert, of St Catherine’s Square, Perth, admitted having an imitation firearm in the common close at his flat on August 23.
He admitted causing PCs Mark Chance and Michael Allardyce to believe unlawful violence would be used against them.
Lambert had been granted bail nine days before the incident.
Depute fiscal Vicki Bell said: “At 10.38pm he had telephoned to report that he believed persons were entering his property. Police found no evidence.
“They returned to reassure him he was safe.”
They found the accused at the common close entrance and he said: “I have a shooter and if anyone comes to my door tonight, they are getting it.”
The officers walked past him to check the flat for weapons and when they turned back they realised Lambert had cornered them.
Miss Bell said: “The firearm had the appearance of a handgun.
“Believing the firearm to be real the officers sought refuge within the home address of the accused, closed the door and locked it.
“One of the officers activated their emergency button to make the control room aware of the situation.
“Minutes after locking the door, the officers could hear what sounded like the accused making efforts to enter the property.
“Then the letterbox opened and the firearm was placed through the letterbox.
“The officers updated the control room, now believing it was an imitation.”
Chasing police cars caught up with Lambert on the outskirts of Perth and clocked him hitting 103mph as he led them on a five-mile chase towards the village of Dunning.
Lambert claimed he did not know it was an offence to carry an imitation gun.
Sentence was deferred on Lambert for reports.