The region's Moscow-installed governor says the gunman has been detained after firing at fellow soldiers and civilians.