THOMPSONTOWN, Pa. (AP) _ A coal train that apparently ran a stop signal slammed head-on into another freight train Thursday, sparking a stubborn diesel fire and killing four of the six crewmen aboard the trains, officials said.

''It was a terrible crash,'' said Denton Adams, an 81-year-old farmer who saw the 8 a.m. collison from his home on a hillside about 100 yards above the site. ''The two engines ran together and then ran on top of each other.''

Twisted wreckage and mountains of coal lay on the tracks where the two freight trains, with a combined five locomotives and 166 cars, collided about a half-mile west of this central Pennsylvania community. The crash started a diesel fuel fire that was declared under control by 12:30 p.m., said Delaware Township Fire Chief Kenneth Leitzel.

The bodies of two of the six crew members were pulled from the wreckage, but the bodies of two others remained in the charred and twisted locomotives Thursday evening. The two other crewmen were slightly injured.

At dusk, workers aimed high-powered lights at the sight and said they planned to continue the cleanup overnight.

A preliminary investigation showed that a coal train headed east apparently ran a stop signal and plowed into the oncoming train carrying tractor-trailers with mixed freight, said Conrail spokesman Bob Libkin in Philadelphia.

He identified the dead, all of Pennsylvania, as Melvin R. Curry, 40, of Altoona, engineer on the coal train; Francis J. Madonna, 46, of Gallitzin, brakeman on the coal train; Russell P. Henderson, 30, of Thompsontown, engineer on the freight train; and Charles S. DeSantis, 56, of Halifax, brakeman on the freight train.

National Transportation Safety Board Official Michael Benson said there was speculation among officials that one or both of the conductors who survived the crash jumped from the moving trains.

Ralph Gratz, a Conrail spokesman at the scene, said it had not been determined if human error or a mechanical problem led to the accident. Drug and alcohol tests were planned for the crew, he said.

Gratz said three recorders that take information such as train speed and when brakes were applied were recovered from the locomotives.

He said he was not sure of the speed at impact, but noted the trains were authorized to travel up to 40 mph in the area.

Gratz said the tracks would not be cleared until at least Friday afternoon.

The coal train, with two locomotives and 105 cars, was headed east from the Shireoaks station near Monongahela to Baltimore, Libkind said. The piggy-back train, with three locomotives and 61 cars, was traveling west from Elizabeth, N.J., to Chicago.

Libkind said three crew members were assigned to each train.

Coal spilled from one of the derailed trains, blocking a state road adjacent to the tracks.

Over a 50-yard stretch of track, rail cars lay in a tangled heap. A plume of smoke rising from the accident could be seen several miles away.

Workers using bulldozers and other heavy machinery spent the day trying to pry the wreck apart.

The two survivors were taken to Lewistown Hospital. Both suffered minor injuries, said hospital spokesman Joe Cannon.

Donald L. Hull, 60, of Poland, Ohio, the conductor of the mixed freight train, was admitted to the hospital with bruises. Jerry L. Hoselbarth, 33, of Altoona, the conductor of the coal train, was treated and released with cuts and bruises.