Fire Chief Joanne Hayes-White said firefighter Tony Valerio died on Saturday.
The 53-year-old was injured while battling a blaze in the city's Diamond Heights neighborhood that killed one of his colleagues Thursday. He has been in the hospital for 40 hours before his death surrounded by family and friends.
"Firefighter/Paramedic Valerio was a dedicated member of the San Francisco Fire Department and of the community," said Hayes-White. "This has been an extremely difficult time for the members of the San Francisco Department. Firefighter/Paramedic Valerio and Lieutenant Perez’s deaths have left all of our members with heavy hearts, they will be greatly missed. Our prayers are with both the Valerio and Perez families as they grieve their losses."
Valerio suffered extensive burns and other injuries while fighting the fire, which was reported at 10:44 a.m. Thursday at a four-story home at 133 Berkeley Way.
Valerio grew up in the Bay Area and graduated from El Camino High School, City College of San Francisco, and San Francisco State University.
He spent 13 years with the city's Department of Public Health and 14 years with the fire department.
Lt. Vincent Perez, 48 was also injured in Thursday's house fire. Perez succumbed to his injuries about an hour following the fire..
San Francisco Mayor Ed Lee said in a statement he was "deeply saddened" by the deaths and called the loss a "terrible tragedy" for the city.
"These two men have dedicated their lives to protecting the people of San Francisco for decades," Lee said.
He added that the deaths of Valerio and Perez were a reminder of the sacrifices firefighters and their family and friends make.
"We are forever appreciative for the brave men and women of the San Francisco Fire Department who put their lives on the line every day for us," he said
Investigators are still trying to determine what sparked the fire.
Fire department spokeswoman Mindy Talmadge said Thursday that some firefighters reported seeing a "flashover," an explosion from intense heat, inside the home. Around that time, an emergency alarm was activated that was attached to one of the firefighters inside the home.
Dispatch received the alert and notified the incident commander, who tried but was unable to reach the firefighter by radio, Talmadge said.
Additional crew members were sent in and found two firefighters, Perez and Valerio, down on the ground and "pretty badly burned," she said.
Condolence messages may be mailed to Fire Station 26, 80 Digby Street, San Francisco, CA 94131.