Police were forced to take shelter behind their cars after a distressed father began hurling chimney pots and slates at them from a Perth rooftop.
Trained negotiators had to talk Danny Stewart down from the block of flats in Stanley Crescent to end the seven-hour siege.
The 24-year-old had become agitated following a disagreement with his partner and when police visited him on a related matter he climbed out of the window of his flat and onto the roof.
During the stand-off, Stewart repeatedly threw chimney pots and roof slates at officers on the street below, causing more than £17,000 of damage to police vehicles and £3,000 of damage to the building.
Depute fiscal John Malpass told Perth Sheriff Court police had first been called to an address in Methven because the accused had been banging on a door there and they later traced him at his home address.
He said: “The accused refused to engage with officers. He was rambling nonsense and his mood was swinging from morose to irate.
“At around 11.50am he suddenly became incredibly agitated and accessed the roof of the building. He began ripping clay chimney pots and slates from the roof and hurling them at police officers.
“Two police cars and a marked police van were struck on a number of occasions.”
Police were forced to erect a large cordon around the area for the safety of the public and those living in the blocks were only able to access their homes when a police riot squad had arrived.
Mr Malpass added: “Police were hiding behind the police cars and had to be extracted by the public order unit, using shields to protect them.”
Solicitor David Holmes, defending, said his client had been upset by events in his personal life.
He said: “He had been told by his partner that the relationship was at an end and was very upset. He had taken tablets to help him sleep – he wasn’t thinking very clearly at the time.
“By the time police came to Mr Stewart he had become very distressed and things escalated from that point.
“He apologises for his reaction and conduct and the trouble he has caused.”
He added that Stewart and his partner had since reunited.
Stewart, a prisoner at Perth, admitted causing a breach of the peace by repeatedly shouting, swearing and refusing to come down from the roof, and by repeatedly throwing clay chimney pots and slates at blocks 13, 15 and 17 in Stanley Crescent on August 27.
Sheriff William Wood deferred sentence for reports but warned Stewart he faces a custodial sentence.