Three people were shot, one fatally, early Monday after a gunman opened fire into a crowd of people in Brooklyn hours before the West Indian Day Parade was set to begin, New York City police said.

Police said a 26-year-old man began shooting at a crowd of people on Empire Boulevard between Rogers and Nostrand avenues in Crown Heights shortly after 3:30 a.m.

A man, 55, was shot in the torso and was pronounced dead at the scene, police said, while another man, 22, was struck in the leg and a woman, also 22, was hit in the ankle. The two were taken to Kings County Hospital Center for treatment of their injuries, which police said were not life-threatening.

Meanwhile, several rounds hit an unmarked police van that was sitting near the scene, shattering the vehicle's glass, according to police. A detective sitting in the van suffered cuts from the glass and was taken to SUNY Downstate Medical Center, police said.

Police said they chased the shooter and arrested him, finding a .45-caliber black firearm that he had dropped. They did not identify the suspect, and charges were pending Monday.

Mayor Bill de Blasio and first lady Chirlane McCray, who has roots in St. Lucia and Barbados, attended a breakfast in Lincoln Terrace Park before the parade stepped off.

De Blasio said the parade "started small" and "become big." He called the city's Caribbean population "a growing community, a strong community, a community well-represented in our administration."

He added: "We are a city of immigrants."

The West Indian Day Parade is one of the city's largest, and it marks its 47th anniversary Monday.

The annual celebration of Caribbean cultures, held in Crown Heights and Prospect Heights, Brooklyn, is expected to bring out well over 1 million spectators to cheer on dancers in heavily feathered and sequined costumes, brilliantly colorful floats and merry steel drum bands. The festivities began overnight with J'Ouvert, where celebrants throw colored powder at one another and bands play jovially.

Flags representing Jamaica, Barbados, Trinidad and Tobago, Haiti, the Dominican Republic and other West Indian nations will be flown, waved and draped along the Eastern Parkway parade route, stretching from Utica Avenue to Grand Army Plaza.

NYPD Commissioner William Bratton has said police will maintain a heavy and visible presence at the parade, which in years past has been scarred by violence including shootings. Last year, two people were stabbed to death and the year before a man was shot dead.

Elected officials and political candidates will also be marching. De Blasio, Gov. Andrew M. Cuomo and gubernatorial and deputy governor hopefuls Zephyr Teachout and Tim Wu were scheduled to be among them.