▶ Watch Video: Massive fire breaks out at New Jersey chemical factory

Authorities brought a massive fire at a chemical warehouse in Passaic, New Jersey, under control Saturday morning. Firefighters remained on the scene of the blaze early in the day, CBS New York reports.

The mayor asked Passaic residents to keep their windows shut as a precaution, which the governor echoed. 

“If you live nearby, keep your windows closed,” New Jersey Governor Phil Murphy tweeted.

The fire began Friday night inside a warehouse called QualCo Incorporated. A huge fireball lit up the night sky in Passaic, just west of Manhattan, followed by a toxic cloud of smoke, according to CBS New York.

The burning chemicals inside could be seen — and smelled — miles away along Route 21.

Security guard Justin Johnson was the only one working inside at the time. He says he was checking the building’s water pressure when he noticed smoke.

Firefighters fought for hours to contain the flames, but the fire continued raging out of control, igniting a nearby chlorine plant, and triggering massive concerns about air quality.

Passaic Mayor Hector Lora took to Facebook to warn people living nearby.

“I am asking residents to keep your windows closed as our fire department, as our emergency responders are assessing the extent of this fire,” Lora said.

While some neighbors walked outside to gawk at the wall of flames, others fled in the other direction.

“We came to check it out to see how bad the situation was because we live right over there. And we don’t know if the fumes are going to come over and if it’s going to have any long-term side effects for like lungs or anything. So it’s really scary,” said Passaic resident Sophia Liu.

Mayor Lora spoke to Fire Chief Patrick Trentacost on Facebook just after 12 a.m. Saturday. Trentacost said most of the building that the fire originated in collapsed. It was used for storage of plastics and pallets. 

According to Trentacost, a portion of the building had chlorine in it, but he said, “That seems to be under control at this time.”

Several roads in the area were closed because of the fire, including the nearby Route 21.

The fire chief said one firefighter was transported to a local hospital after getting hit in the face by debris.

New York City warned residents they may be able to see or smell smoke from the fire.