A construction crane standing 45 stories above the street burst into flames and partially collapsed onto a nearby high-rise in Manhattan Wednesday — in a wild scene that injured a dozen people and sent panicked New Yorkers scrambling for safety.

Workers were moving a 16-ton load of concrete to the 36th floor of 550 Tenth Ave. in Hell’s Kitchen around 7:30 a.m. when a fire erupted in the machine deck at the top of the crane, city Department of Buildings officials said.

The operator in the crane’s cabin tried to douse the flames with a fire extinguisher but had to flee for his life when the blaze spread, according to the FDNY.

The machine’s 180-foot-long boom then collapsed, striking a building across the street at 555 Tenth Ave. before crashing to the street below, dramatic footage showed.

“All I heard was a loud boom,” construction worker Max Montanez told The Post in the aftermath. “It shook the building.

“We just all started running down the stairs. Guys [were] getting stampeded on. It was bad.”

Officials first said six people had been injured, including two firefighters — one of whom was hospitalized with chest pains — and four others hit by falling debris. The FDNY later updated the total number of people hurt to 12, three of them firefighters. All injuries were minor.

The crane was working on an under-construction 45-story building near Hudson Yards between West 41st and West 42nd streets when the fire broke out, officials said.

“The smoke was jet black and the fire was blazing,” said construction worker Marcus Harris, who was on the 44th floor. “It didn’t look like it was dying down. I was like, ‘Oh God!’ I said, ‘Forget this, let’s go.’”

Hamza Nagi, who owns Superior Gourmet Market Place, said her employees had to be evacuated by the FDNY after falling debris shattered the windows of the shop.

“They saw the crane coming down through the glass,” Nagi said. “They had a front-row seat to it. They face-timed me. They said, ‘Boss, you wouldn’t believe this.’”

Paul Lo, who was visiting from California and was staying at the nearby Yotel Hotel, described the fire as “blazing.”

“You could see the flame from even from 42nd and 9th,” he said. “There was black smoke. The fire department was quite far or maybe it was the water pressure. They didn’t get it at first.”

“Welcome to New York,” witness Heidi Elmore tweeted, along with a video of the FDNY response. “Crane next to my hotel is on fire and collapsing so we had to evacuate.”

Another Twitter user said the fiery burst “sounded like lighting or an explosion” from the top of the crane. 

More than 200 firefighters and emergency workers responded to the site, said FDNY First Deputy Fire Commissioner Joseph Pfeifer.

According to the preliminary investigation, the fire was believed to be accidental, sparked by hydraulic fluid leaking from the engine compartment and onto a heated metal plate, two sources told The Post.

Nearby streets were closed for hours after the collapse, with the NYPD urging New Yorkers to avoid the area.

“You see the debris on the street, this could have been much worse. We were fortunate that this was not a busy time of day,” Mayor Eric Adams told reporters at the site.

“We’re also fortunate that first responders responded in such a manner and made the right evaluation of how to look at the fire and crisis we were presented with and came up with [the right solution],” Adams said.

Gov. Kathy Hochul later issued a statement about the collapse, calling it “a reminder of the incredible challenges that the men and women building back our city face.

“It’s just a reminder of the dangers that so many people are willing to put themselves through and we are the beneficiaries, we the citizens of this great state and city.”

The crane was owned by New York Crane & Equipment Corp., founded by controversial self-described “King of Cranes” James F. Lomma, who died in 2019. He was acquitted of manslaughter and three other charges in connection with the deadly collapse of a crane on the Upper East Side in 2008.

City records show that the crane, built in 2009, was up to date on all required certificates and licensing.

The company declined to comment on Wednesday.

The lower portions of the crane “were all structurally stable and none were currently in danger of a structural collapse,” the buildings department said, adding that a stop work order was issued for the project as the investigation continues.

DOB Commissioner James Oddo said there was one previous unrelated misstep on the project, in which workers hit a Con Ed vault when they were first excavating the site.

General contractor Monadnock Construction said some of its workers were among the injured and in stable condition.

“We want to acknowledge and thank the FDNY and the other first responders who were able to safely remove workers and any pedestrians from the location and secure the site,” the statement said.

“Safety is a priority for Monadnock Construction Inc. at this and every other project. We are fully cooperating with all regulatory agencies and are available for any assistance that is needed,” it added. “We are unable to provide any additional details regarding the incident at this time.”

A spokesperson for Gotham Org., the developer on the project — a mixed-use tower set to open next year — said in a statement the company is helping authorities who are investigating the cause of the accident.

“Our priority is always the safety of the construction personnel contracted to perform the work,” the spokesperson said.

“While the cause of this incident is still under investigation, we are working collaboratively with the general contractor, FDNY and all necessary City agencies to learn more.”

In 2016, a 600-foot-tall construction crane came crashing down onto buildings, pedestrians and parked cars in downtown Manhattan, killing a Harvard-trained mathematician on his way to work and injuring three other people. 

Additional reporting by Larry Celona