The kung fu masters whose fists of steel once helped save kingdoms have all but faded from the legendary Shaolin Monastery, yet their famous brand of martial arts lives on in China.

The ancient monastery at the foot of Song Mountain in central China, where Buddhism took root more than 1,400 years ago, still houses a handful of aged monks who chant and tend to their altars, the last guardians of the Shaolin tradition.

The romantic aura of Shaolin will die off with these old men, but China's Communist leaders have begun to encourage the teaching of its kung fu as a "secular" sport bereft of the Buddhist flavors and mythology.

Peking also hopes to cash in on the box-office popularity of kung fu movies by coproducing with Hong Kong film-makers a swashbuckling extravaganza based on the lore of Shaolin's soldier-monks.

"This is part of the Chinese culture that we have an obligation to pass on," said Liang Yiquan, a kung fu expert who acted as a film consultant and teaches Shaolin martial arts at a school near the monastery.

Ironically, Shaolin began not as a center for martial arts, but as a refuge for meditative prayer. An Indian Buddhist monk named Boddhidarma is supposed to have settled here in the year 520 after sailing across the Yellow River on top of a reed.

Boddhidarma became famous for reputedly sitting motionless before a cave wall for nine years, breaking only to acknowledge a disciple who is said to have cut off his left arm as an act of devotion to attract the monk's attention.

From the discipline of Zen meditation sprang China's most lethal form of martial art, a fast and acrobatic style popularized in the West by Bruce Lee movies and the American television series "Kung Fu."

In its heyday hundreds of years ago, Shaolin boasted more than 2,000 soldier-monks frequently enlisted by emperors to wield their long sticks and bare fists against ambitious warlords or marauding Japanese pirates.

Their warrior skills were honed by exercises requiring almost superhuman endurance. Hands were toughened by thrusting fingers into pails of flint shards. Legs were strengthened by stamping dents into stone floors. Agility was assured by running with 20-pound sandbags tied to arms and legs.

Shi Daochan, 74, regarded as the last true Shaolin master, still cloaks himself in bright orange robes and practices light boxing everyday, preparing, he says, to join his famous forebears in the monastery's extraordinary graveyard of stone, Christmas-tree-shaped obelisks called "the forest of pagodas."

The old man, whose shaved pate, porcelain coloring and wispy black beard make him look like a museum piece, talks wistfully of the days when Shaolin kung fu was more than show business.

"You really had to be determined to master this technique," he said in an interview at Shaolin. "The practice was very hard. But today with all the advanced weapons, it's no longer very useful. It's a pity."

Shaolin masters of yore, he said, dedicated their lives to the monastery at an early age, no later than 12, when many saw their parents for the last time. Physical training was complemented by intense study of the Buddhist tracts, for a master had to be a priest as well as soldier.

According to legend, novices trying to qualify as masters had to fight their way out the front door of the monastery against 36 Shaolin experts. Each expert was allowed one maneuver to stop the disciple.

Masters were so fast, so the legend goes, they could land a deadly blow without ever revealing their hands. They could anticipate every move of an opponent, jump like kangaroos, leap over high walls with the help of a whip and fend off large numbers with the special Shaolin stick made of hardwood found in the Song Mountain forest.

In the days of palace intrigue and chronic warfare, Shaolin monks fashioned a kind of superman ethic: helping the good against evil forces.

Every master took an oath of abstinence forbidding acts of killing, stealing, womanizing, boasting and drinking alcohol.

But the ban on killing was easily lifted by a higher calling.

"Killing a tyrant was a virtue," said the old master Shi. "We had a saying, 'If one tyrant is alive, then 10,000 innocent people can't rest in peace.' "

For Shaolin monks, helping the good usually meant shoring up whichever emperor was in power, and their timely assistance was handsomely rewarded.

Perhaps the monastery's most triumphant days came during the Tang Dynasty (618-907) after a small army of Shaolin warriors helped vanquish an imperial challenger and captured the enemy general's nephew. The emperor repaid them with thousands of acres of land around Song Mountain and gave them a special dispensation freeing them from their stricture against wine.

Their military exploits on the side of law and order are part of Chinese folklore. One monk known as "King of Sticks" supposedly single-handedly fought off a peasant uprising with a fire poker during the Sui Dynasty (589-618).

The Shaolin monastery was badly damaged in three fires. During the Cultural Revolution (1966-76), Red Guards smashed Buddhist figures, harassed the old monks and locked up Shi. Shaolin was closed.

Communist leaders who preach disdain for China's feudal past decided to reopen Shaolin three years ago partly to capitalize on tourist interest in kung fu. Peking has paid to refurbish the multitiered temple grounds, and a new roof recently was placed on top of the hall of 1,000 Buddhas where the stone floor shows ruts said to have been stomped out by past masters.

"In the old society, landlords and [Mandarin] officials came and left behind some money," said Yong Zheng, 74, another monk. "Now it's up to the [Communist Party] Central Committee to subsidize us."

In the new China, Shaolin martial arts are no longer the exclusive preserve of the monastery. The physical skill without its religious coloration is now taught all over China as a form of exercise and self-defense.

No Shaolin monks have been ordained since 1936, but the government recently has agreed to allow the state-controlled Buddhist association to put forward novices.

A few miles from the monastery, the Shaolin martial arts sports school was opened last year with government support. The first class of 61 youngsters culled from all parts of China undergo a modified version of the physical drills endured by the fabled kung fu masters of old.

Living in a run-down, castle-shaped building that once housed temporary highway builders, the students practice in a dusty courtyard 3 1/2 hours daily, punching heavy sandbags and kicking their legs to eye level.

The students, whose curriculum is strictly secular, will train between three and six years, then return to their home provinces as coaches.

Trainer Liang Yiquan, a fifth-generation kung fu master who begins each day practicing by smashing his fist against the school's brick wall, said his students are learning the pure form of Shaolin martial arts, not the version dramatized in popular films.

"Shaolin martial arts is very practical," said the teacher. "It takes lots of hard work. What you see in the movies is not a bad imitation. But it's for entertainment."