Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

OAKLAND, Calif. — Aaron Marin was convinced his life was over as smoke engulfed a California warehouse last year in what turned out to be the country's deadliest building fire in more than a decade.

But Marin survived and testified Wednesday at a preliminary hearing for the two men charged in the blaze at the Oakland building known as the Ghost Ship.

Recovery teams examine the charred remains of the warehouse that caught in Oakland, California. LUCY NICHOLSON / Reuters

Marin recalled that people who were unable to escape came up a flight of stairs shaking their heads and saying, "No."

"I sat there and accepted the fact that it was just over for me," he said about the fire on Dec. 2, 2016, that killed 36 people.

Marin was the first witness called by prosecutors as they try to persuade Alameda County Judge Jeffrey Horner that defendants Derick Almena and Max Harris should stand trial on involuntary manslaughter charges.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Related: What is the Ghost Ship collective?

Almena rented the warehouse and lived there with his family. Harris also lived in the building and helped Almena book musical acts and sublet the space to artists.

Prosecutors say the men knowingly created a firetrap and deceived the building's owner, police and fire officials about people living there. The two have pleaded not guilty and say they are being scapegoated.

The warehouse had been illegally converted into living space for artists, was cluttered and had no fire alarms or sprinklers.

The fire occurred during an unpermitted electronic music concert.

Related: Ghost Ship sailed through regulators' fingers for years

Marin, a musician who was staying at the warehouse, described the space as a "museum" filled with musical instruments, trailers and other items. Going inside was like entering Disneyland, he said.

He said he was alerted to the fire by the smell of smoke. Within seconds, he noticed flames coming from behind a turntable. People were screaming as the power went out.

Marin, who became emotional at times, testified that he remembered the location of a window and made his way to it with his eyes closed to protect them from smoke.

He tried to alert other people, but it was loud. At the window, he said, he screamed for help and a ladder.

"'There's people dying in here,'" he recalled shouting. He climbed out and dropped safely to the ground on soft mud. He said he was not injured.

The hearing is expected to last several days.