CALGARY -- After nearly an entire day of a large police presence in a northeast neighbourhood — including an order for residents of Pineridge to shelter in place — an alleged gunman was taken into custody late Thursday night.

It all began to unfold at 5:50 a.m. Thursday and stretched for 17 hours.

Officers were initially called to the 600 block of Pineland Road N.E. for reports of property damage — but later learned that an armed man had been threatening to shoot others.

Police confirm several shots were fired into the neighbourhood from a basement suite of a home just before noon, and say the authorities used a number of tactics to bring this situation to a peaceful end — including flash bangs and tear gas to force the man outside.

Streets were blocked off, residents were told to shelter in place, and a nearby school was put into lockdown.

Police also used a robot to drop off a cell phone and charger for communication, calling out to the man over loud speakers and using a drone to survey the area.

One resident told CTV News what her daughter witnessed out front of their home.

"There were police and there were police walking around with shotguns and an unmarked police car was on the front lawn, and they got a phone call from Tamarack Village, that's the complex, saying stay in your house and don't come out," said Marnie Johnston.

The standoff ended around 11 p.m. when a man was arrested and taken to hospital for what was described as minor injuries.

While police say they are thankful to numerous other organizations for assistance and the investigation into the incident is ongoing.