James Davis, 41, a Brooklyn councillor, former police officer and anti-violence crusader, died after being shot twice in the chest from close range by his political rival, Othniel Askew, 31.
Mr Askew was then shot several times by the security officer on the floor below. Mr Askew was challenging Mr Davis for the Democratic nomination in the upcoming city council elections. But he had not filed the correct papers to put his name on the ballot.
He had arrived at city hall as Mr Davis's guest and so did not have to pass through metal detectors, the mayor, Michael Bloomberg, told a news briefing: "I've had some tough days in my life and in city hall, but I don't think I've ever had a day as tough as this."
Earlier yesterday, the two appeared to have been reconciled. Mr Davis introduced Mr Askew to a councillor they met on the way to the meeting, saying: "This is the guy who was once against me, but now he's with me."
The council had just finished the ceremonial part of its twice-monthly session when Mr Askew opened fire. Councillors and spectators dived for cover as the rotunda echoed with the sound of gunfire.
"It was so loud you couldn't hear the direction," said the city council photographer, Dan Luhmann. "At first, it was absolute stillness. And then people rushed out and ducked under desks and it was chaotic.
One of the councillors, Charles Barron, said: "It was panic. It was bedlam. It was chaos. People were panicking and had scared looks on their faces. Some were screaming and crying."
As soon as the shooting was over a stampede began. "We were running really fast," said another councillor, Gale Brewer. "People were tripping, they were falling - they were even falling over the line in front of the guardrail. And then we ran down into the rotunda and we were told by the police to run even further.
"People were jumping over the fence in the city hall parking lot to get out into the street."
Mr Davis was an outspoken presence on the council. An independent African-American who often fell foul of the Democratic party machine, he was elected in 2001.
He joined the New York police department in 1993, 10 years after he was allegedly beaten by two white officers.
He started the charity Love Yourself, Stop the Violence, a group dedicated to stopping violence in urban America.
Within hours of his murder flowers had been placed outside his office in Clinton Hills and mourners had gathered. The killer was sitting on the balcony near Mr Davis when he suddenly shot him, according to police sources.
"I saw him walking right by people and shooting in a downward position," Mr Barron said. "I heard at least four or five shots myself. He was just squeezing. He was just pulling off the rounds, shot after shot."
The plainclothes officer, who was on the chamber's floor, shot up at the gunman, striking him five times, police sources said.
Though Mr Askew's precise motive was unclear, Mr Bloomberg condemned the shooting as an act "that strikes at the very essence of democracy."