A city councilman known as a crusader against urban violence was shot to death inside City Hall on Wednesday by a political rival who bypassed security with a gun by walking into the building along with his victim.

A plainclothes police officer shot and killed the assailant, Mayor Michael Bloomberg (search) said. The gunman's ties to the councilman allowed him to bypass security, he added.

"Obviously, there was a breakdown someplace," said Bloomberg, who was yards away in his office at the time of the attack but unharmed. Bloomberg said that all officials, including himself, will now be required to go through the building's metal detectors.

Brooklyn Councilman James Davis (search), a former police officer and outspoken presence on the council, died from two gunshots to the chest as 14 bullets rattled across the landmark lower Manhattan building, authorities said.

The gunman, Othniel Askew, 31, died a short time later at a hospital, according to a police source. The two mortally wounded men were found lying side by side on the balcony overlooking the council chambers.

City Hall erupted in chaos after the shots were fired, when it was unclear whether the gunman had escaped. As shots echoed across the second floor of City Hall, people dove for cover beneath their desks and the rotunda filled with screams.

"It was so loud you couldn't hear the direction," said City Council photographer Dan Luhmann. "At first, it was absolute stillness. And then people rushed out and ducked under their desks and it was chaotic."

Police officers, including some in riot gear, swarmed nearby streets and sealed entrances and exits to the building as they searched for the gunman. The Brooklyn Bridge (search) was shut down, and subway service was suspended at the City Hall station and nearby stations for about an hour.

Three hours before the shooting a man identifying himself as Askew called the FBI's New York office to allege that Davis was harassing him over the upcoming primary election, FBI spokesman Joe Valiquette said.

Askew had filed papers to oppose Davis in a three-way council race in this fall's Democratic primary, Bloomberg said. But he was not an official candidate because he had not filed enough petition signatures.

Davis spokeswoman Amyre Loomis said Davis and Askew were political opponents who had recently called a truce, and had met three times in recent weeks.

Both men arrived together Wednesday at City Hall, where Davis planned to introduce legislation on workplace violence, Councilman Charles Barron said.

Barron said Davis introduced him to Askew, saying, "This is the guy who was once against me, but now he's with me." Askew offered a firm handshake and an intense stare, Barron said.

A short time later, Barron stood staring into the balcony as the gunman shot down at Davis' prone body with a .40-caliber pistol.

"He wasn't shooting randomly," Barron said.

Davis, who was 41 and black, joined the police department in 1993, 10 years after he was beaten by two white officers, according to his Web site.

In 1991, Davis founded "Love Yourself Stop the Violence," a not-for-profit organization dedicated to stopping violence in urban America. He was elected in 2001, and was a minister.

The paths of Davis and Askew apparently crossed only recently. When asked about the potential rival in June, Davis was quoted as saying he had never heard of Askew.

A political flier distributed in Davis' district described Askew as an Air Force veteran and Brooklyn native. An Air Force spokeswoman could not immediately confirm that. The flier also listed a traditional agenda: smaller school classes, affordable housing, aid to small businesses, improved sanitation.

The shooter was one of about 100 people on the balcony inside the second-floor council chambers and was sitting near Davis when the gunfire erupted after 2 p.m, according to witnesses. The security officer, who was on the floor of the chamber, shot up at the gunman, striking him five times, said Police Commissioner Ray Kelly.

The councilman was carrying a licensed gun but never unholstered the weapon, Kelly said.

Security had been stepped up at City Hall since the Sept. 11, 2001, terrorist attacks. Besides the installation of metal detectors, a uniformed police officer is posted at the gate.

Employees and police officers were not required to pass through metal detectors.

Sen. Hillary Clinton called the death of Davis, a man who devoted himself to law enforcement and stopping violence, "a tragic, terrible irony."

Davis' brother, Geoffrey, emerged from the hospital around 4:45 p.m.

"The system killed my brother," Davis said. "They knew that he would fight. We're going to keep fighting and do the right thing."

Late Wednesday night, hundreds of family members, friends and colleagues reflected on Davis' life during a memorial at Brown Memorial Baptist Church in Brooklyn.

"He was a man with a heart so big he just had to give more," said council Speaker Gifford Miller. "Even when he was busting my chops, he had a smile on his face, and I usually had a smile on mine."