It went off just after 11 p.m. on the pitcher's mound of a baseball field in Pelham Bay Park.
The professional grade fireworks created a large plume of smoke and a blast that could be heard for miles, as far away as New Jersey and Yonkers.
Some residents were concerned that a bomb had exploded, and about 100 calls came in to 911.
The force of the blast shattered windows in three homes on nearby Middletown Road, and also blew out windows of cars in the area.
Mirrors and pictures fell off walls of homes for blocks around. There were no injuries.
Police are trying to find out who was responsible.
The episode caused enough commotion that the city sent out a notification to subscribers to its emergency alert system early Tuesday.
The notification said authorities were looking into a "loud noise possibly caused by illegal fireworks."
Authorities found pieces of the pail and unexploded fireworks scattered around the ballfield.
They were taken to the NYPD firing range to be detonated. Duct tape and a box that housed the detonation device was tested for DNA and fingerprints.