Twenty-one cars of a CSX Corp. freight train carrying automobiles, food and paper derailed early yesterday north of the Takoma Metro station, crashing onto the subway's major power rail and cutting off Metro service between Silver Spring and Northeast Washington.

No one was injured when part of the 134-car Chesapeake, traveling from Brunswick, Md., to Philadelphia, ran off the west track at 4:40 a.m., tearing up 800 feet of the parallel Metro tracks and sending one car careening into the side yard of a Chestnut Street house.

"Just a great, huge noise . . . . It sounded like a terrible shriek," said Patsey Leclercq, who has lived for 32 years in a three-story house where Chestnut Street dead-ends with the tracks. "There wasn't any bump, no thud that I recall, just an awful shriek in the night."

The cause of the derailment had not been determined yesterday. Investigators were looking at the four-member crew's operation of the train and the possibility of an equipment malfunction, said Wendy DeMocker, spokeswoman for the Federal Railroad Administration.

Metro officials, who used buses to shuttle about 15,000 stranded commuters, said the Silver Spring and Takoma Red Line stations would remain closed during the weekend as work crews mount a massive track repair and cleanup effort. Metro said it would assess by tomorrow whether service can be restored Monday morning.

Within the mile-long train, two carloads of hazardous chemicals caused concern to public safety officials and raised the question of a predawn evacuation of the heavily residential area. But the cars, carrying toluene diisocyanate, used to make plastics and paints, and sodium hydroxide, a corrosive chemical, did not derail and remained intact. The timing of the accident, when Metro was not running, was fortunate.

Yellow and silver auto carriers were jackknifed onto Metro's third rail, which carries 750 volts of direct current. A line of jammed freight cars formed a zigzag along the tracks.

Giant metal wheel assemblies, torn on impact from the bottoms of cars, were strewn about the crushed-rock track bed. A black Norfolk & Western boxcar lay parallel to the track at the Piney Branch overpass. The chicken- and barbed-wire fence separating Metro's two inner tracks from the parallel CSX tracks hung in shards.

The train was traveling 42 miles an hour, according to railroad administration officials, well below the 55 mph that CSX sets as its rule for freight trains. The government limit for that section of track is 60 mph. One source said investigators have ruled out the possibility that the accident was caused by faulty track or by track repairs being undertaken in the area.

The accident tore up track and roadbed, causing estimated damage of $200,000 to the railroad cars and $25,000 to CSX track, officials said. A CSX official said part of the railbed would have to be replaced.

Metro spokeswoman Beverly Silverberg said 10 of the derailed cars crashed through a chain-link fence onto Metro property. Metro did not have a dollar estimate of property damage.

In the morning rush hour, Metro officials scrambled to provide 34 buses to shuttle morning rail commuters from the Silver Spring and Takoma stations to Fort Totten, the next station on the Red Line. The same system was used for the afternoon return, and most riders said the service went smoothly. Shuttle service will continue during the weekend.

Metro officials said resumption of service is tied to the ability of CSX to clear the tracks. CSX brought heavy equipment from Gettysburg, Pa., to clear the tracks and began righting the fallen cars by 11:04 a.m. By 5 p.m., four more cars had been rerailed.

Hard-hatted workers from Metro and CSX, many wearing fluorescent orange safety vests, crawled between the cars and, in some cases, under them. CSX safety and insurance officials, wearing ties and white shirts in the 80-degree heat, walked the tracks, trying to figure out what had happened and how the cleanup should proceed.

Pulled by two locomotives, the Chesapeake left Brunswick at 2:45 a.m. with a cargo that included new Chevrolets, auto parts headed for a Delaware factory and four hopper cars of flour.

In railroad terms, the Chesapeake is an eastbound train because it was headed toward the East Coast. At the point of derailment, the train was traveling almost due south because the CSX tracks to Philadelphia dip south through Washington from Brunswick, then north through Baltimore to Philadelphia.

At 4:40 a.m., the explosion of noise and sparks jolted many residents of nearby houses awake, sending them outside.

"It almost came over right on top of me. It almost came over into my garden. It took two years off my life," said Adelean French, 76, who for 20 years has lived just yards from the train tracks in a tidy two-story brick house at 504 Fern Place NW.

Fannie Johnson, who has lived adjacent to the tracks at the end of Chestnut Street for 12 years, said she was awake when she heard the train approaching. "I at first didn't pay it that much attention until it got louder and louder and the house started to shake," she said. "All of a sudden, there was a crash -- it was real loud."

"I looked out and saw it then," Johnson said. Less than 20 feet from her house lay a silver car on its side. Next to it was another car at a 45-degree tilt. The massive cars contained flour. No contents were spilled.

Many residents of the tree-lined, working-class neighborhood that abuts on the track said they have learned over the years to block out the thundering of trains. Several said yesterday that they rolled over and went back to sleep after the crash.

"After the first year or so, trains coming through are an everyday occurrence -- just like an alarm clock. You can sleep right through it," said Michael Silver, who said he did just that and that his mother told him about the crash when he awoke several hours later.

John Hoppenjans, who lives across Takoma Avenue from where the trains jackknifed onto the third rail, said, "Everyone knew when they heard the noise that something was wrong. It was not the right noise of the train."

Roger McGary, the Takoma Park volunteer fire chief, who lives about a block away on Baltimore Avenue, said that when the train hit the rail carrying 750 volts, there were "three or four loud pops or bangs . . . then dead silence." McGary said he at first was most concerned that the electricity running through the line be contained. The cars that hit the line were partly charred.

After the crash, city blocks turned into early morning block parties as residents left their homes. Some returned, after retrieving clothes and coffee, to examine the tangle of train and tracks.

Many residents recalled a similar derailment in July 1976 when a Chessie freight train, the forerunner of CSX, crashed near Blair Road. Twenty cars loaded with new autos cascaded over a concrete retaining wall and damaged four houses.

Clark D. Jones, CSX's safety manager for the Baltimore district, who was dispatched to the site of yesterday's incident, was also on the scene in 1976. "It's a bad one, but I've seen a lot worse," Jones said of yesterday's accident, noting the absence of injuries.

Jones, stressing that he had no idea what caused yesterday's incident, said that few freight train derailments are caused by human error. He noted that the weather -- hot days and cool nights -- can sometimes cause the tracks to expand and contract.

Police and fire officials from Washington and Takoma Park turned out in numbers early in the morning. Police cruisers blocked intersections as traffic was redirected until the D.C. police's hazardous-materials unit could assess the situation.

Traffic problems were minimal, however, as most streets were reopened by 7:30 a.m.

"As major train derailings go, we're fortunate," said D.C. Deputy Police Chief W. Kris Coligan, commander of the 4th District, which includes the accident site straddling the Maryland-District border.

"If you're talking about injuries, it's not major. If you're talking about number of cars derailed, it's major."

The gates to the Silver Spring and Takoma Metro stations were locked yesterday, but Metro officials made frequent announcements. Lines formed at the telephones as workers, many of them unaware of the derailment, called work places and spouses.

At the Silver Spring station yesterday afternoon, Bob Gamble, an auditor for the National Endowment for the Humanities, said he was running about an hour late but "it's really not all that bad. Considering everything, everyone has been very considerate. Let's face it, if the rail is not straight, the train can't run." On a normal weekday, about 19,300 riders board at the two Red Line stations.

The accident scene attracted a constant stream of people throughout the day who came to stare and wonder and take pictures. Eleanor Maroney arrived with her son to take pictures, explaining, "I'm taking a photography class at UDC and I'm out here having a ball."

"We haven't ever had this much excitement on Chestnut Street," said Carolyn Lambright, 31, who grew up in a two-story wooden house two doors from the tracks. "Our street is on the map now."