ARMED police swooped on a tower block in Leith as a sniper with an airgun took pot shots at people in the street below.
Dozens of armed officers descended on Cables Wynd House at midday yesterday in a bid to disarm the gunman, who sparked terror in the surrounding streets.
The shooter laid siege to the area for most of the afternoon, causing chaos for traffic and pedestrians after forcing the closure of several streets for four hours while police hunted him down.
A 26-year-old man has now been charged with firearms and drugs offences and is due to appear in court today.
The major alert was sparked after workers on a nearby building site reported being fired at.
Staff working at the new-build housing development directly behind Cables Wynd House, known locally as the "Banana Flats", had to rush for cover and call police after shots from a gunman believed to be shooting from a window on the third floor of the building.
An armed response unit immediately sealed off the area to pedestrians and threw a cordon around nearby roads.
The contractor, Stirling-based Tannon Limited, stopped all work for the rest of the day because of safety concerns, although no staff members were injured.
The cordon ringed streets surrounding the council-owned tower block and extended from Tolbooth Wynd, through Giles Street, Henderson Street, parts of Great Junction Street, Mill Lane and Sheriff Brae.
Residents were prevented from getting into their homes while the hunt for the gunman continued.
People who gathered at the cordon were also urged to take cover behind buildings to reduce any risk of shots being fired at them.
At one point, a young schoolboy who was unaware of the events walked under the cordon into the gunman's firing line, forcing alarmed police officers to rush to get him back beyond the tape.
After tracing the gunman and raiding a flat, a man was eventually led from the building and taken away in a police van just before 4pm. Soon after, the cordon was lifted.
Residents at Cables Wynd House today said they were angry that they were not given more information from authorities about what was happening.
One woman, who did not want to be named, said she had been met by a wall of silence when trying to find out what was going on.
She said: "I tried buzzing down to the concierge but they wouldn't answer the buzzer and I phoned the council but they said it was a police matter.
"We didn't know what was going on - for all we knew there could have been someone taken hostage or a fire in the building. It was frightening."
A police spokeswoman said: "A 26-year-old man has been cautioned and charged with firearms and drugs offences. He is expected to appear in court later today."
A spokesman for Tannon Limited confirmed that nobody working on the site was injured and said work was expected to continue today.