LAKE CITY, Fla. (AP) _ Bulldozers were called in to help clear the wreckage left by a 38-car freight train derailment that forced hundreds of people to flee their homes because of a leak of lethal gas.

Columbia County Sheriff Tom Tramel lifted an evacuation order Sunday evening after chemical-spill crews plugged a leak in a 30,000-gallon tank car and trucked away the liquid anhydrous ammonia remaining in the tanker.

Initial reports from the sheriff's office put the evacuation figure as high as 1,000 people, but Tramel could confirm only 350 evacuees. The last of them returned to their homes Sunday afternoon.

No serious injuries were reported during the 24 hours that the gas spewed southward across wooded hills and grazing land.

Heavy equipment operators were using bulldozers to clear twisted boxcars, flatbeds and automobile carriers off the Seaboard System Railroad track, the only east-west line for regular freight traffic in the Florida Panhandle.

Seaboard spokesman Mark Sullivan said the line would probably be closed for several more days. He said he had no idea of what the cost in lost freight or damaged equipment would be.

The cause of Saturday's derailment, in which the two-mile-long train jumped the track as it was heading from New Orleans to Jacksonville, was still unkown, Sullivan said.

He said he suspected that a faulty rail car caused the accident, but teams of investigators from the U.S. Department of Transportation and the National Transportation Safety Board had not confirmed the suspicion.

''We think it's probably equipment failure, but the clue to that is likely buried at the bottom of the pileup,'' Sullivan said.

However, the immediate danger from the anhydrous ammonia had passed. The chemical, which vaporizes when it escapes into the atmosphere, is used in fertlizers and refrigeration.

The chemical, which is extremely irritating and can be fatal if inhaled, billowed hundreds of feet into the air Saturday and Sunday. Five other tankers carrying the liquid lay strewn around the leaking car, but remained intact.

''We're going to more or less let people use their own discretion,'' said Nelson Bedenbaugh, director of civil defense operations for Columbia County, after the evacuation order had been lifted.

''You really can't breathe anhydrous ammonia, it takes all the oxygen out of the air,'' said Bedenbaugh. ''All I know is you can't breathe.''

In 1978 and 1979, derailments of trains carrying anhydrous ammonia forced evacuations in several northern Florida communities, including Lake City.