After work, an FDNY lieutenant suffered a fatal heart attack at his Orange County home early Saturday in what fire officials are treating as a line-of-duty death.

Lt. Brian J. Sullivan, 54, of Squad Company 41 in the Bronx suffered the heart attack at his home in Monroe the morning after completing a 24-hour tour of duty. Sullivan had nearly three decades of service with the department.

“This is a tragic loss for the Fire Department and for the City of New York. Brian Sullivan was a dedicated Firefighter who put himself in harm’s way for 27 years to protect the lives of others,” Mayor Bill de Blasio said in a statement. “Our hearts and prayers go out to his wife Irene, and two daughters Nicole and Samantha.”

Fire Commissioner Daniel Nigro noted that Sullivan was a member of the FDNY’s elite Special Operations Command.

Sullivan’s last tour began Thursday and included seven emergencies and a kitchen fire in the Bronx. He complained of chest pain throughout the 24-hour shift. After the heart attack, he was rushed to the Orange County Medical Center, where he died just after midnight.

Sullivan was the 1,153rd line-of-duty death for the FDNY, the department said. A bunting ceremony will take place at 3 p.m. Tuesday at the Squad Company 41 firehouse.