TUCSON, Ariz. (AP) — A gunman took several hostages during a failed bank robbery on Monday, then killed himself after authorities surrounded the building, police said.

No hostages appeared to have been injured during the two-hour standoff, Police spokesman Sgt. Mark Robinson said.

He said the unidentified gunman demanded money from a teller and was leaving the bank when he saw a county prosecutor's office investigator approaching. The investigator, who was wearing a gun and badge and who had intended to do some banking, called for help, Robinson said.

The gunman briefly took several people hostage but had released all but a few bank employees when he killed himself.