At least 12 officers were injured in San Francisco early Tuesday when a "hostile crowd" hurled fireworks and glass bottles toward police responding to a fire in the street after midnight. 

The San Francisco Police Department Mission Station shared video Tuesday saying officers responded to a large crowd and a fire at 24th Street and Harrison at approximately 12:39 a.m. 

The footage showed a chaotic scene as a debris burned in the middle of the intersection, and explosive could be heard going off over the sound of music blaring. 

"Officers attempted to disperse the hostile crowd," SFPD Mission Station tweeted. "Fireworks and glass bottles were thrown at officers. 12 officers were injured as a result." 

OUSTED SAN FRANCISCO DA CHESA BOUDIN NOT RULING OUT ANOTHER RUN FOR OFFICE 

"Despite staffing issues, officers eventually were able to clear the crowds from the street and SFFD [San Francisco Fire Department] was able to extinguish the fire before further damage occurred," a follow-up tweet added. 

The incident occurred hours after hundreds gathered at San Francisco’s Pier 39 on the waterfront for a commissioned large firework show despite heavy fog reportedly ruining the view for onlookers. 

In a June 30 press release on fireworks safety, the San Francisco Police Department reminded residents and visitors that "all fireworks (including those branded as "Safe and Sane") are illegal in San Francisco."

It cited municipal code that bans any person, firm, company, corporation, or association from firing or discharging fireworks within city limits unless they’re granted jointly written consent from the fire marshal and chief of police. "Each year more than 12,000 fireworks-related injuries, half of them children, are treated in hospital emergency rooms," the department said. "Possession of fireworks such as skyrockets, bottle rockets, roman candles, aerial shells, firecrackers, and other types that explode, go into the air, or uncontrollably move on the ground can lead to a citation or an arrest.

The press release said the city and county of San Francisco was holding an Independence Day fireworks show along the waterfront Sunday, starting at 9:30 p.m. 

CLICK HERE TO GET THE FOX NEWS APP

"You can watch fireworks from vantage points along San Francisco’s waterfront," it said. "Note: Due to COVID-19, there are no City-sponsored festivals or gatherings this July 4th and the State of California strongly recommends that anyone planning to attend the Fourth of July fireworks be fully vaccinated, and obtain a negative COVID-19 test prior to attending the event, or wear a face covering."