Firefighter Gordon Ambelas passed away late Saturday after battling a fire in a South Williamsburg high-rise building.
Ambelas, 40, responded to a two-alarm fire inside the Independence Towers housing complex at 75 Wilson St.
Fire Department officials said blaze set off at around 9:30 p.m. in a unit on the 19th floor of the 21-floor building.
Authorities said the fire lieutenant was attempting to make sure no victims were left in the burning apartment when he became trapped in a bedroom, where he suffered what was only described was life-threatening injuries.
Fellow firefighters were eventually able to pull him out of the building. Found unconscious, Abmelas was rushed to the nearby Woodhull Medical Center, where emergency workers declared the 14-year veteran dead.
On Sunday afternoon, Fire Commissioner Daniel Nigro said that investigators determined the fire was caused by an accidental electrical spark from an air conditioning unit's electrical cord pinched between the wall and a bed frame.
The apartment was reportedly heavily cluttered, which can make rescue attempts more difficult, officials said.
"We have lost a real hero tonight and our hearts our heavy," Mayor Bill de Blasio said in front of the hospital to reporters, calling Ambelas' loss terrible and tragic.
Abmelas, a Staten Island resident, is survived by his wife and two children.
His death is reported as the first death of a firefighter in the line of duty in more than two years.
"One of New York's bravest has paid the ultimate price," he added, "and we all mourn his loss."
Officials said two other firefighters escaped the fire with minor injuries treated at Bellevue Hospital, and two residents declined medical attention.
Follow Chester Jesus Soria on Twitter@chestersoria