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.

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 as many as 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.

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.

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.