OTTAWA: A gunman who held several people hostage at an office building in Edmonton, western Canada has surrendered to police ending a tense day-long standoff, national broadcaster CBC reported.

It said the hostages had been released unharmed after a near 12-hour standoff Wednesday which saw heavily armed police and SWAT teams surround the downtown building where he was holed up.

Television pictures had shown hundreds of white-collar workers streaming out of the Workers Compensation Board building as police ringed the building and negotiated with the unidentified gunman.

"At 8:42 this morning, we received a call that a man with a rifle had walked into the Workers Compensation building," Edmonton police spokesman Jeff Wuite told reporters earlier.

The CBC reported that 11 hostages had been taken, nine of whom were released in the initial hours of the standoff.

The workers, some in tears, streamed out as police ringed the building and blocked off surrounding streets. Nearby buildings were locked down, but not evacuated.

Two robots typically used by the police bomb squad to dispose of explosives were also deployed.

Police herded some 700 displaced workers onto parked buses and set up positions behind parked cars and trees.

An acquaintance of the armed man at the center of the hostage-taking told the Edmonton Journal that the man is a former construction worker with a grudge against the compensation board.

Don Bellerose, who lives in the same assisted living facility as the hostage-taker, said the gunman had felt pressured to return to work early after a doctor damaged his knee ligaments during a routine examination.

Bellerose also said the man had grown increasingly agitated in the last month due to a custody dispute with his ex-wife.