City inspectors discovered numerous fire hazards last week at a transitional housing facility in West Oakland that burned Monday, killing at least three residents and leaving another missing.

After Friday’s inspection of 2551 San Pablo Ave., a fire inspector found problems with the building’s fire alarms, sprinklers, emergency lighting and signage, smoke detectors, fire extinguishers and evacuation maps. Extension cords were being used in lieu of electrical outlets and there were mattresses and furniture stacked in the courtyard.

The landlord was ordered to abate the conditions within 30 days, but the structure was gutted by a four-alarm fire early Monday.

City fire inspection report from Friday. | Via Oakland Fire Department

The fire broke out at about 5:40 am. By the time firefighters arrived, smoke and fire was thick in the hallways and the second floor was so hard to reach that some residents were dangling out of windows. Four people, including two children, were taken to a hospital. When firefighters searched the building hours later, they found three people dead. A fourth remains unaccounted for.

The first victim was identified Monday as Edwarn Anderson, 64, a resident of the building.

The building has a long history of code complaints, according to documents released by the city's building code enforcement department. Deferred maintenance by the landlord was recently reported by master tenant Urojas Community Services, a nonprofit that operated a veterans’ drop-in center and other services for the homeless and people struggling with drug addiction.

James Cook, a lawyer representing Urojas, said Monday that he was fighting efforts by landlord Keith Kim to evict Urojas. Cook said that there were numerous safety violations in the building, such as piles of garbage, leaking plumbing and exposed wiring.

A city code enforcement inspection on March 6 verified Urojas’s complaints, including a major plumbing leak on the third floor which had opened a hole in a ceiling, a toilet leak that had damaged the floor of the kitchen in one unit, and electrical violations.

The inspector was informed by Urojas that as much as half the building was occupied by squatters. Previous interactions between city staff and building residents indicated the third floor was leased by Dignity Housing West Inc., but a tenant who complained about no heat had no lease with Dignity or legal status to be in the unit.

The city received a total of 20 code enforcement complaints dating back to 2007. In September 2016, a third-floor tenant complained of of a missing drain pipe in the kitchen sink that was leaking water as well as a broken smoke detector and other violations. Three months later, nothing had been fixed.

In March 2016, another tenant complained of no hot water and a missing smoke detector. There were complaints of garbage piling up in September 2015 and again in April 2016.

Oakland fire Battalion Chief Erik Logan said Monday afternoon that firefighters will return to the building this morning to search for additional victims and determine the cause for the fire. All three floors of the building collapsed, creating additional challenges for safety officials.

Oakland Fire Department is leading the investigation with the assistance from the federal Bureau of Alcohol, Tobacco, Firearms and Explosives.