CALGARY -- A near miss involving a transit driver set off a tense confrontation between a shooter in a wheelchair and police officers that led to the gunman's death.

Police warned residents in the northwest Calgary neighbourhood of Huntington Hills to stay indoors and in their basements on Sunday afternoon following news of a shooter. Officers in a police helicopter flying over the area used a bullhorn to reinforce the message.

"The service received a 911 call that a Calgary transit bus driver reported a shot fired into the bus that narrowly missed the driver," police Chief Roger Chaffin said at a Monday news conference.

"It's believed that there were five passengers inside that bus, but fortunately no one was injured."

Bullets being shot from a home also hit a number of surrounding residences.

More than a dozen officers, including members of the tactical team, surrounded the home before the gunman was shot and killed.

"Numerous shots were fired indiscriminately from the resident. Area residents were advised to stay inside and seek shelter," said Chaffin.

"Officers set up containment while shots continued to be fired from the home," he said."Several attempts were made to resolve the situation peacefully; however, the suspect exited the residence and the situation escalated resulting in the discharge of a service firearm ... and killing the suspect."

The Alberta Serious Incident Response Team, which reviews police shootings, is investigating.

A news release said the man, who was 53, was in a wheelchair and left the home through the back door. He was armed with a handgun and engaged in a direct confrontation with police, ASIRT said.

It said immediate medical assistance was provided but he was declared dead at the scene. The handgun was recovered. No one else was in the home during the standoff.

An autopsy was scheduled for Tuesday.

Chaffin said details about the man, the number of shots fired and the shooting itself won't be released until the investigation is complete.

The chief said there had been a number of visits to the home in the past, but they were non-criminal in nature and didn't involve "this level of violence."

The attack was not related to any gang activity and appears to be "unique to this particular person," he said.

The officers involved in the shooting are receiving support from their peers and psychological services, he added.

Alberta Liberal Leader David Swann said the man shot was David McQueen and that he was suffering from a serious mental illness.

McQueen wrote in his Facebook page that he was brought up in Windsor, Ont., and broke his neck in 1994.

Swann said McQueen contacted his constituency office many, many times.

"He was always polite, though he was certainly agitated and paranoid of all government. David was also angry. Angry with the injury which all but paralyzed him, angry with a system he felt failed him, and angry with those who represented that system," Swann said in a statement.

"My thoughts and condolences go out to David McQueen's family and friends, and to those police officers involved in the tragedy. My thoughts are also with those, like my staff, who interacted with Mr. McQueen and are left, today, feeling they could have done more."