An FDNY battalion chief was killed and several others — including six police officers and nine other firefighters — were injured when a marijuana-growing operation inside a Bronx house exploded early Tuesday, officials and sources said.

Michael Fahy of Battalion 19, a 17-year member of the FDNY, was struck in the head by part of the roof that blew off the private home at 300 W. 234th St., a somber Mayor de Blasio said at a press conference.

“He was a devoted father of three – a good man,” de Blasio said at NewYork-Presbyterian/Allen Hospital.

“We just spent time with his wife and with his parents here at the hospital and saw the unspeakable pain when they were told formally that they had lost Michael,” he said. “Our hearts go out to the Fahy family — a family so devoted to the city, Michael’s father was fire chief before him. A family that gave so much and today made the ultimate sacrifice to the city.”

Fahy’s father retired after 33 years as a battalion chief, the same rank as his son, who became a member of the Bravest in 1999. He was promoted to lieutenant in 2004, captain in 2007 and battalion chief in 2012.

The danger of the job “was exemplified by one of our rising stars,” an emotional Fire Commissioner Daniel Nigro said about the father of two boys and a girl, ages 6, 8 and 11. “He was on the rise, he was a star, a great man.”

Firefighters responded to the house near the corner of Tibbett Avenue in Kingsbridge after someone in the neighborhood reported what they thought was a gas leak around 6:20 a.m. But when firefighters entered the house, they found what appeared to be a homemade drug laboratory inside a dark room, and immediately requested police, according to sources.

They also heard a hissing noise on the property, suggesting there had been a break in the gas line, law enforcement sources said. Firefighters opened up windows in the home, which smelled heavily of gas.

Cops and firefighters were waiting outside for a Con Ed crew to arrive after they evacuated the house when it blew up, sending a large piece of the roof flying into the air and landing on Fahy. He was rushed to a hospital in a police car after firefighters removed the debris, a source said.

“(He) was brought here as quickly as possible but he was not to be saved,” a choked-up Nigro said. “It’s a terrible loss for the Fahy family and a loss for the Fire Department family. We feel it deeply, we feel it deeply today.”

Two civilians and two Con Ed workers also were hurt, Nigro said. All of the injuries were not life-threatening, he said.

Police Commissioner James O’Neill said the rental building was being investigated as a marijuana grow house. The sole person inside the home had gotten out around the time firefighters arrived. An arson investigation was launched, and cops are searching for the man who left the home shortly before the blast, sources said.

The last FDNY line-of-duty death occurred in July 2014, when Lt. Gordon Ambelas died in a Brooklyn fire.

Neighbors described the frantic moments after the deafening blast.

Maureen Murphy, 45, said she was frightened by the noise.

“When I came out of my house this morning I got really scared. The police, the fire department, everybody was rushing in here,” said Murphy, who works with special-needs kids.

“I live about three blocks away and I heard the explosion — it was loud, my windows shook. It was so close. I didn’t know if it was my building or not. That’s how loud it was. … My daughter came running and said, ‘Oh my God! Mom, what happened?’”

Her daughter was particularly on edge because she works near the scene of the recent bombing on West 23rd Street in Chelsea.

Another resident who lives a couple of blocks from the blast site said she was doing her dishes when the whole neighborhood was rattled.

“There was a huge boom, the whole building shook. My dogs got scared. They were freaking out. The police station is right across the street,” said Jennifer Mullane, 32, a physical therapist assistant. “And I really knew something was wrong when all of the cops started running. There was a lot of smoke and ashes were coming down.”

Shortly after the explosion, Jay Soto, 57, told The Post: “Everyone came out and asked, ‘What was that?’ I could see that it was serious. There are many ambulances and firetrucks. I saw black smoke.”

On Tuesday afternoon, police arrested the man who was listed on the lease of the Kingsbridge home, Julio Salcedo, with a warrant for a petty crime, according to law-enforcement sources. Salcedo, 34, was picked up in Cliffside Park, NJ, by the Regional Fugitive Task Force, which is made up of NYPD detectives and US marshals.

Police were questioning a second person believed to be connected to the explosion, sources said.

Records show the home is owned by Violeta and Onesimo Guerrero. They own several other properties in the same neighborhood, including two residences that were visited by cops on Tuesday.

Tenants at the home that exploded had allegedly been tapping into a neighbor’s gas line, and investigators suspect that’s what caused the initial leak, according to sources.

NYPD Commissioner James O’Neill said the rental building was being investigated as a marijuana grow house after police were tipped off about it a couple of weeks ago.

Neighbors said U-Haul trailers and vehicles were showing up at the house “all the time.”