A hostage situation in a central Phoenix high-rise ended peacefully Thursday night when the gunman surrendered and his captives were released, a police spokesman said.

Sgt. Andy Hill said negotiations between police and the gunman resolved the situation.

"We were able to figure out a way to show him his wife and sister in a very safe manner," Hill said. "It was a very tenuous situation."

Police said George L. Curran, 42, of Chandler, a Phoenix suburb, pulled a gun during a legal proceeding and took as many as nine people hostage. One female captive later escaped and another was allowed to leave.

Commander Kim Humphrey said police do not know a motive yet: "Maybe he was at the wrong place at the wrong time. Maybe he didn't like somebody," Humphrey said.

Police the hostages were taken inside a hearing room in a National Labor Relations Board office on the building's 18th floor. The floors immediately above and below were evacuated.

A few hours into the standoff a female captive escaped by saying she had to go to the bathroom and another was allowed to leave.

Hill said police were in contact with the gunman during the standoff, and the man had been in touch with members of his family. He said authorities had successfully negotiated several things with the gunman, but did not elaborate.

Hostages' relatives and co-workers were at a nearby restaurant, a Fire Department spokesman said.

It was not immediately clear if the man was a participant in the labor proceeding — which an NLRB official called a "litigated trial" — or a bystander.

The Arizona Republic reported on its Web site that one of the hostages had called his girlfriend, a Republic reporter, to outline the gunman's demands.

According to the newspaper, Chris Doyle told his girlfriend that the gunman wanted to see his wife and sister as soon as he walked out. If that happened, he would surrender, the paper reported.

Cornele Overstreet, an NLRB regional director, told the local Fox TV affiliate that the gunman first "shouted out something" and grabbed a secretary as she was coming out of a bathroom.

Sioux Jeffrey, who works in another office on the same floor, said a man from the labor office came to her workplace "and told us to evacuate. 'There's a man with a gun.'"

Everyone quietly left and walked down the stairs, she said.