Police closed off a social work office and carers centre for more than four hours after a teenager climbed on the roof and refused to come down.
The 16-year-old, who police wanted to speak to about an earlier incident, climbed on to the roof in Muirhouse and at one point trained negotiators were brought in to try and talk him down.
A wide area which included residential streets, a private business and council buildings was sealed off more than four hours during the stand-off.
Officers swooped on Muirhouse Crescent earlier the same day to deal with a “disturbance” which also saw a police car damaged.
It is understood that the boy had clambered on to the flat roof of the North West Carers Centre to evade officers.
The Muirhouse Social Workers Centre was sealed off but a city council spokesman confirmed that staff were still able to access the building.
A woman claiming to be the boy’s grandmother said she had tried to speak to him, adding that family members were “embarrassed” by his behaviour.
The boy, who was wearing only shorts and a T-shirt, climbed on the roof around noon and could be seen swearing and throwing small stones at police.
He chose to jump off rather than use the ladder placed against the side of the 15ft building, and was immediately detained by the police surrounding the building.
The response to the incident saw an ambulance, at least five police vehicles and around 20 police officers in Muirhouse.
Residents told police that their response was “a bit much” for one boy on a roof. But a female officer told them it was justified because they had a “duty of care” to the boy and had to make sure he got down safely.
Police were unable to confirm the age of another male who was detained at around noon after a police car was damaged. It is understood the two incidents are linked.
Cllr Cammy Day said the car had been taken away after its front windscreen was smashed.
A police spokesman said: “A male has been detained after a police car was damaged in the Muirhouse area of Edinburgh around 12pm today.
“The police car had been responding to an ongoing disturbance in Muirhouse Crescent.”
Two males were still being questioned by police yesterday afternoon but no charges had been brought at that time.