At least nine people died when a fire tore through a warehouse in Northern California during a rave party and officials fear the death toll from the tragedy could rise to 40.

So far, nine bodies have been recovered from the site, which is not considered a "crime scene." Alameda County Sheriff's Sgt. Ray Kelly said Saturday the bodies have been taken to the coroner's office to be identified.

Kelly says there are more bodies trapped in the debris that are hard to reach and need to be "cut from the wreckage." 

He says excavators, a crane and dumpster trucks are being brought in to help in the recovery and the building is being flooded with light to allow crews to work through the night.

Kelly says crews will have to move very slowly as they pull out debris and look for more victims. He said that at least two dozen people remain missing.

Firefighters responded to the three-alarm fire at the warehouse in Oakland around 11:30 p.m. local time Friday. They fought the fire for hours before putting it out.

Officials said there may have been between 50 to 100 people inside the two-story building in Oakland's Fruitvale district when the fire broke out. People either got out unscathed or were trapped inside the structure, which had no sprinkers.

California Governor Edmund G. Brown Jr. today issued the following statement: "Anne and I were saddened to learn of last night's tragic fire in Oakland. Our thoughts are with the entire city in this difficult time and we extend our condolences to the family and friends of those lost."

The city of Oakland started investigating nearly three weeks ago whether people were illegally living in the warehouse.

Darin Ranelletti, of the City of Oakland Planning Department, says the city had received reports of people living illegally in the building, which was only permitted as a warehouse.

They opened an investigation on Nov. 13. He says an investigator went to the premises on Nov. 17 but could not gain access to the inside of the building. Ranelletti says they had not yet confirmed people were living inside.

oakland fire

Firefighters clear an entry to a smoldering building after a fire tore through a warehouse party early Saturday, Dec. 3, 2016 in Oakland. (AP)

Photos posted online of the warehouse - called the "Oakland Ghost Ship" - showed pictures of a bohemian, loft-like interior made of wood and cluttered with beds, rugs, old sofas, pianos, paintings, turntables, statues and other items.

Neighbors had complained of trash piling up outside the property and concerns the garbage posed a danger, according to the city's Planning and Building Department website.

Just before noon local time officials said they were beginning "a recovery and identification process."

"This is just a tragedy," Sgt. Ray Kelly, a spokesman for the sheriff in Alameda County said.

The warehouse party featured musician Golden Donna’s 100% Silk West Coast tour.

Most of those who were killed were found on the second floor, the East Bay Times reported.

Fire Chief Teresa Deloach-Reed said firefighters saw no evidence that smoke detectors were activated during the fire and there was no sprinkler system in the building, according to the paper.

The blaze is already being called one of the deadliest single-structure fires in Oakland’s history, if not the deadliest, the paper reported.

“This is a true loss for the city, for the firefighters who responded, and the people who lost family and friend. It’s just tragic, a real tragedy,” the paper quoted the fire chief as saying.

At a morning news conference, Deloach-Reed said the warehouse space was divided by partitions and the only staircase to the second floor was made of wood pallets.

“The way the building is situated, it made it difficult to escape,” she said.

She said the cause of the fire was under investigation.

Friends and family of those unaccounted for were on social media early Saturday looking to confirm the whereabouts of their loved ones, according to the paper.

Some people have posted images and messages on Facebook of people they believe are missing, while other have posted that they had escaped safely, the paper reported.

A photographer who lives in the building told reporters the flames forced him to leave behind a friend who broke his ankle.

“It was too hot, too much smoke, I had to get out of there,” Bob Mule said, according to the East Bay Times. “I literally felt my skin peeling and my lungs being suffocated by smoke. I couldn’t get the fire extinguisher to work.”

Mule, who suffered minor burns, told KTVU he hoped his friend was alright.

The Associated Press contributed to this report.