After five years, the memories still intrude like bizarre nightmares for Yuan Hairong, who survived the massive earthquake that destroyed the northeastern city of Tangshan and left her an orphan.

Now 18, she often lies awake at night, reliving the painful events of July 28, 1976; she awoke at 3:45 that morning covered by debris in her uncle's bungalow, pulled herself out of the collapsed structure and ran five miles through the eerily quiet city to her parent's home, unable at first to recognize the neighborhood. She wept over the dead bodies of her parents and two brothers and spent the next six weeks living in a dusty, makeshift tent so low she could not sit up. She survived on biscuits and rainwater collected in discarded cans.

Yuan's tragedy is just of hundreds rehashed daily at the Foster Red School, an extraordinary orphanage the Chinese Communist Party runs as a refuge for survivors of the most devastating earthquake in modern history.

In normal times, orphanages are rarely heard of in a society held together by intricate, far-flung family ties. When young children lose both parents, they usually are raised by relatives or neighbors in communities that serve as extended families. The abandoned children of China are quickly adopted by childless couples who register at local hospitals.

The Tangshan tremor, however, called for extraordinary relief measures. Not only was the city reduced to rubble, but the disaster wiped out families and neighborhoods, claiming 242,000 lives and leaving thousands of youngsters as sole survivors within blocks of their homes. For weeks after the earthquake, children are said to have roamed the city looking for relatives, surviving on rations handed out by rescue teams.

When the dust began settling and hundreds of children were still homeless, provincial authorities got approval from Peking to set up Foster Red School, the first orphanage of its kind to educate and house the young disaster survivors. Beginning Sept. 8, 1976, 551 orphans, including Yuan, were taken 300 miles by train to this capital of Hebei Province to begin a family life succored by the Communist Party.

In that short train ride, the children, whose ages ranged from 6 months to 17 years, moved from a squalid world of death and destruction to a protective, well-scrubbed community of red brick buidings converted from an old kindergarten and adjoining party school.

At Foster Red School, the orphans found teachers, nurses and counselors -- one staff member for every two children -- to help them cope with their personal tragedies and adjust to their new collective family.

"We make the children understand that the party cares for them," said Dong Yuguo, the school principal. "We educate them as socialist men and women who can contribute to the socialist construction of China. Our philosphy is that the party serves as their parents."

Thus, Foster Red officials raise the orphans as adopted children of the Communist Party, substituting Marxist ideals for traditional family values and emphasizing ideology in the classroom. Younger orphans are instructed to begin each day reciting the school slogan: "The party is like the sunshine, and we are like flowers."

In its role as parent, the party even has assumed the job of naming three infant girls who arrived at the orphanage too young to know their names. They now are called "Tree Under the Cultivation of the Party," "Red Child Under the Cultivation of the Party" and "Heart Under the Cultivation of the Party."

Although the youngest orphans sing revolutionary songs from memory and can recite Maoist parables, they know little of their own family history and have never officially been told why they came to Shijiazhuang.

"We avoid telling the little kids what happened," said Dong. "If we tell them, it would give them [psychological] trouble. When they grow up, they will find out on their own."

Although the orphans eventually adjusted to their adopted home, Dong said, many of the youngsters had difficulty shredding the trauma of the disaster. Some balked at living indoors, afraid that the building would collapse. Other panicked during rainstorms, recalling the fierce winds, thunder and lightning that preceded the 1976 quake.

Slowly the anxieties and bitterness disappeared, he said, and the orphans began accustoming themselves to the highly structured, ideologically charged environment imposed by school officials.

The orphans discovered the party to be a strict parent, prescribing certain forms of behavior, such as outspoken fealty to socialism, and dictating stringent rules. For example, baths can be taken only on Saturday. Socializing among teen-agers of the opposite sex is expressly prohibited.

In a spartan dormitory room, five large boards covered by quilts and propped up by wood horses serve as beds for 10 teen-age girls. All of their clothing is stored in a small lacquered cabinet, which remains locked except on Saturday mornings, when the orphans are allowed a change of outfit.

As if to emphasize the school's laboratory atmosphere, officials strenuously try to exclude outside influences. Orphans are discourage from venturing into Shijiazhuang, even though they live in the heart of the city. The orphanage provides almost every service, from barbering to medical care, giving the youngsters little incentive to leave the school grounds.

Every year, Foster Red turns down dozens of requests to adopt orphans because, according to Dong, "the party says we are a socialist country and has asked us to take care of the children on a socialist basis."

Since the orphanage opened, 200 residents have graduated, completing middle school at Foster Red and returning to Tangshan to help reconstruct the once important industrial city. After the youngest orphans, now 5 years old, reach 18 and graduate from middle school, the orphanage will close down, said Dong.

For some of the older students who vividly remember details of the devastating earthquake, the past five years have helped cushion the tragedy, offering proof to the theory that misery loves company.

But even now the pain crosses Chen Bing's face as he struggles to recount his personal loss, stammering and looking down at his feet.

Just 12 years old at the time, Chen explained, he heard a thundering noise followed by the crack of falling buildings. Trapped under collapsed beams of his house, he screamed for help. After a neighbor help free him, Chen stumbled over his dead parents.

After roaming Tangshan in search of relatives, Chen heard about Foster Red School and jumped aboard the first train headed for Shijiazhuang. At the orphanage, he said, the constant sharing of gruesome stories with fellow survivors helped ease his grief.

"We find relief in our common backgrounds," said Chen. "We are all orphans."