LANCASTER, Calif. (AP) _ A freight train derailed when it hit tracks damaged in an automobile accident minutes earlier Sunday, overturning 33 cars and spilling up to 60,000 gallons of crude oil and diesel fuel, officials said.

The train scattered people trying to free the driver from the damaged car.

The engineer apparently saw the track damage and hit the brakes, but the 10-engine, 66-car train hit the tracks, and four engines and 33 cars overturned, authorities said.

At least three tanker cars leaked, spilling 40,000 to 60,000 gallons of diesel fuel and oil, said county fire dispatcher Terry Hart. Each oil tanker has a capacity of 25,000 gallons, he said.

Sand dikes were erected to contain the oil, and there was no fire, Hart said.

The accident on the Southern Pacific Railroad tracks about 50 miles north of Los Angeles occurred shortly after 3 a.m., said fire dispatcher Bob Goldman.

A compact car carrying three men apparently ran a stop sign, roared up an embankment, hit the tracks, then flipped over and landed about 20 feet away, said Los Angeles County sheriff's Deputy Dan Cox.

The driver was trapped inside the car, and bystanders were struggling to free him when the freight train came into view, Cox said.

''The citizens (helping the driver) saw the train coming and literally had to jump out of the way when it derailed,'' but the car was not struck, Cox said.

The driver of the car, Marty Wilbrecht, 23, was pried free and taken to Antelope Valley Hospital Medical Center.

Sheriff's investigators said they were looking into the possibility that Wilbrecht was driving while intoxicated. He was not booked because of the seriousness of his injuries, authorities said.

Wilbrecht was listed in serious but stable condition with multiple fractures before being transferred to County-USC Medical Center, said Antelope Valley hospital spokeswoman Frankie Richards.

Also transferred was James Robert Williamson, 20, who had multiple lacerations and a fractured lower right leg. He was listed in serious but stable condition, Ms. Richards said.

Forrest Okey, 38, was in good condition at Antelope Valley with facial injuries, she said.

Both Williamson and Okey were passengers in the car.