Image copyright AP Image caption The fire caused the roof to collapse

Officials have opened a criminal inquiry into a fire that killed at least 36 people at a warehouse party in Oakland, California.

The premises had already been under investigation prior to the fire over possible building code violations.

The warehouse had no sprinklers and one ex-resident called it a "death trap".

Fire crews are still working at the scene and have warned that the number of fatalities is likely to rise.

It is thought between 50-100 people were inside the venue when the fire broke out late on Friday.

The blaze caused the roof to collapse on to the second floor, part of which then fell through to the ground floor. Its cause is not known.

"When we started this investigation, if you had told us that you would have 33 victims, we wouldn't have believed you," said Sgt Ray Kelly of Alameda County, before the death toll rose by another three. "I don't know how many people are left in there."

"People want answers. People want to know that the investigation into this fire is very thorough," Mr Kelly added.

The opening of a criminal investigation allows authorities to preserve evidence and see if there was any criminal responsibility, whether through arson or negligence.

Media playback is unsupported on your device Media caption Oakland residents held a vigil for victims of the fire

On Monday, the city of Oakland began releasing the names of those killed, but withheld the name of the youngest, a 17-year-old.

The Ghost Ship fire's victims

Cash Askew, 22

David Clines, 35

Nick Gomez-Hall, 25

Sara Hoda, 30

Travis Hough, 35

Donna Kellogg, 32

Brandon Chase Wittenauer, 32

Image caption The venue know as the Ghost Ship housed artists' studios and held music events

One survivor said people initially thought that the smoke was part of the show.

"I noticed the smoke and thought, 'Is that a fog machine?' Then people were running frantic," Chris Nechodom told SF Gate.

"I looked to the back and it was just from wall to wall, the ceiling was on fire.

Officials described the interior as like a maze, with the warehouse packed with furniture, mannequins and other objects, the only exit from the second floor a makeshift stairwell.

The building, known as the Ghost Ship, was used to house artists in improvised studios but several reports say people were illegally living there too.

Neighbours had complained to the city about rubbish piling up on the street outside, and about the illegal tenants.

Image copyright Getty Images Image caption Memorial events have been taking place nearby to the warehouse

Image copyright AFP Image caption Local DJs have been paying tributes at the makeshift memorial

Image copyright Reuters Image caption Criminal investigators and seeking the cause of the fire, which is still unknown

Image copyright AP Image caption This photo shows the building's interior in 2014

"That place was just a death trap,'' former resident Shelley Mack told the Associated Press. "I didn't think it was going to last this long before it went up or somebody shut it down.''

Families of loved ones are now being asked to gather things like toothbrushes and combs to aid with DNA identification.

Media in Oakland named Derick Ion Almena as the co-operator of the collective with his partner, Micah Allison.

A Facebook post by him lamenting the loss of his belongings but saying he was "blessed that my children and Micah were at a hotel safe and sound" drew a barrage of criticism online.