A suspected gunman was shot at the scene by police, and taken to hospital with life-threatening injuries.