Updated

A shooting a few blocks off the route of the annual West Indian Day Parade, scarred by violence at least twice in the last several years, left two police officers wounded and three people dead Monday, Mayor Michael Bloomberg said.

An officer was shot Monday night in one of his arms and was hospitalized but was expected to survive. Another officer was grazed by a bullet.

At least three other people were hit in the shooting, said police.

One of the dead people was a bystander, police said, and the other two were criminal shooters.

Witnesses said the shooting went on for at least 30 seconds. Area resident Thomas Kaminsky said it sounded like machine-gun fire outside his building.

The gunshots rang out in the Crown Heights neighborhood of Brooklyn after the parade, which was marred by fatal shootings in 2003 and 2005. Post-parade parties are common, but police wouldn't say if the fatal shooting was related to them.

Earlier Monday, revelers had filled the streets in colorful costumes during the parade. But gun violence shocked the parade festivities to a stop in spots. Police said four people were shot and wounded during the parade along its route and a 15-year-old boy was grazed by a bullet nearby.

Police helicopters hovered overhead Monday during the parade, and officers on scooters and on foot patrolled the surrounding blocks.

The upcoming 10th anniversary of the Sept. 11 terror attacks plus a spate of holiday weekend violence have put the city "on heightened alert," police Commissioner Raymond Kelly said before the parade stepped off.

"We're doing a lot of things both seen and unseen," the commissioner said.

A City Council member was detained at the parade after getting into a confrontation with police.

Councilman Jumaane Williams, of Brooklyn, said he was put in handcuffs by officers after marching on the parkway. He called his detention "an easily avoidable incident."

Williams had been given permission by a police official to walk along a blocked-off street but was then stopped by other officers, his spokesman Stefan Ringel said. He was held for about 30 minutes before being released, and no charges were filed.

Williams was with an aide for Public Advocate Bill de Blasio. The aide, Kirsten John Foy, also was handcuffed and detained, Williams said.

A video of their detention, distributed by the public advocate's office, shows Foy being thrown to the ground as he's taken into custody along the parade route.

Police said Williams and Foy were stopped from entering a frozen zone near the Brooklyn Museum, where a crowd formed and someone punched a police captain. They said Williams and Foy, who were handcuffed, were taken across the street and detained until their identities were established and then were released.

They said the police commissioner met with Williams and Foy and ordered an investigation into the matter.

Bloodshed over the weekend included a Sunday shooting in the Bronx in which eight people, including children, were wounded. Four other people were shot, one fatally, in the East Flatbush section of Brooklyn early Monday.

Kelly said some of the shootings were associated with the West Indian Day festivities.

"Frankly," he said, "this is something that does happen at this parade."

Bloomberg said the problem is "too many guns on the streets of this city."

He said New York has some of the toughest gun laws in the country, "but because it's so easy to buy guns in other states and just drive them in and sell them in the back of your car ... we've got to do something about it. This just can't go on."

Before the violence Monday, the parade thundered down a Brooklyn thoroughfare with its usual colorful, musical energy.

The annual Labor Day parade celebrates the culture of the Caribbean islands and is one of the city's largest outdoors events. Modeled on traditional Carnival festivities, it features dancers wearing enormous feathered costumes, music and plenty of food.

"This parade is fabulous!" said Arnold Caballero, who was manning a huge barbecue on a sidewalk. "There are people of all countries, and you meet friends you haven't seen for years."

The 52-year-old Trinidad native estimated that by day's end he would sell about 500 pounds of jerk and curry chicken, beef and pork from the stand he's run for a decade with two friends.

Caballero's friend Agnes Cherryl Phillips, a 55-year-old native of Grenada, added: "This is the most excellent parade you can ever have, with music and loved ones who come from all over America, from Miami to Canada."

High-spirited spectators behind police barricades joined in with impromptu dancing as music pounded from massive loudspeakers aboard floats rumbling through the Crown Heights neighborhood, which also is home to the world headquarters of the Lubavitch Orthodox Jewish community.

Some sat on their porches watching people waving the bright flags of their native islands and enjoying Caribbean delicacies sold by vendors whose barbecues released delicious-smelling smoke into the late summer air.

Antonneal Waldron, 3, was resting on a bench with her parents and 5-month-old brother after strolling the parade route. She summed up the experience in a few words: "Walk, walk, walk! Color, color, color!"

Her mother, Jennifer Woldron, completed the picture, saying, "It's an American event that represents people of many nations: food, flags, islands, music."

Gov. Andrew Cuomo stopped by a pre-parade breakfast before heading to upstate communities where residents are still cleaning up from Tropical Storm Irene.

"Thank you for sharing your culture, your language, your music, your food, your diversity," he told organizers.

The governor said he would take buckets of jerk chicken to Irene victims.

As the parade wound down on Eastern Parkway, 14-year-old Alexcia Gordon stood smiling by her stand of hand-crocheted earrings -- almost a foot long, in all colors, selling for $10 a pair.

"I already sold 27 pairs yesterday, so I had to go home and make some more last night," said the beaming teenager, decked out in the finery she creates.