It is said that a Buddhist monk from India named Buddhabhadra, or Ba Tuo in Chinese, came to China during Emperor Xiaowen's reign during the Northern Wei Dynasty period in 495AD. The emperor liked Buddhabhadra and offered to support him in teaching Buddhism at court. Buddhabhadra declined and was given land to build a temple on Mt. Song. There he built Shaolin, which translates into small forest.
Thirty years after Shaolin was founded, another Buddhist monk called Bodhidharma from India came to China to teach Yogic concentration, known commonly today by the Japanese term "Zen" Buddhism. He traveled throughout China and finally came to Mt. Song where he found Shaolin Temple where he asked to be admitted.
The abbot, Fang Chang, refused and it is said Bodhidharma climbed high into the mountains to a cave where he meditated for nine years. It is believed that he sat, facing the cave wall for much of these nine years so that his shadow became permanently outlined on the cave wall. (Incidentally, the cave is now a sacred place and the shadow imprint has been removed from the cave and moved to the temple compound where you can view it during your visit. It is quite remarkable.) After nine years, Fang Chang finally granted Bodhidharma entrance to Shaolin where he became the First Patriarch of Zen Buddhism.
Supposedly Bodhidharma exercised in the cave to keep fit and when he entered Shaolin Temple, found that the monks there were not very fit. He developed a set of exercises that later became the foundation for the specialized interpretation of martial arts at Shaolin. Martial arts were already widespread in China and many of the monks were retired soldiers. Thus existing martial arts exercises were combined with Bodhidharma's teachings to create the Shaolin version of Kung Fu.
Originally used as exercise to keep fit, the Kung Fu eventually had to be used against attacking assailants after the monastery's assets. Shaolin eventually became famous for its warrior monks who were masterful in their practice of Kung Fu. Being Buddhist monks, however, they were bound by a set of principles called martial ethics, wude, that includes prohibitions such as "do not betray your teacher" and "do not fight for frivolous reasons" as well as eight "hit" and "do not hit" zones to ensure the opponent will not be too seriously injured.
Not long after Boddhidharma entered Shaolin, Emperor Wudi banned Buddhism in 574AD and Shaolin was destroyed. Later, under Emperor Jingwen in the Northern Zhou Dynasty Buddhism was revived and Shaolin rebuilt and restored.
During turmoil early in the Tang Dynasty (618-907), thirteen warrior monks helped the Tang emperor rescue his son, Li Shimin, from an army aiming to overthrow the Tang. In recognition of their help, Li Shimin, once emperor, named Shaolin the "Supreme Temple" in all of China and fostered learning, teaching and exchange between the imperial court and armies and the Shaolin monks. Over the next few centuries until Ming loyalists used Shaolin as a refuge, Shaolin Temple and its style of martial arts enjoyed a flourishing of development and advancement.
As a haven for Ming loyalists, Qing rulers finally destroyed Shaolin Temple, burning it to the ground and destroying many of its treasures and sacred texts in the process. Shaolin Kung Fu was outlawed and the monks and followers, those who lived, were dispersed through China and to other, lesser, temples following Shaolin teachings. Shaolin was allowed to reopen again about one hundred years later but rulers were still distrustful of Shaolin Kung Fu and the power it gave its followers. It was burned and rebuilt several times over the following centuries.
Today, Shaolin Temple is a practicing Buddhist temple where adaptations on the original Shaolin Kung Fu are taught. According to some sources, the original Shaolin Kung Fu was too powerful so was replaced by Wu Shu, a less aggressive form of martial arts. Whatever is practiced today, it is still a place of dedication and learning, as can be seen by the hundreds of youngsters practicing outside on a given morning. There are now over eighty Kung Fu schools around Mt. Song in Dengfeng where thousands of Chinese children are sent to study, as young as age five. Shaolin Temple and its teachings remain impressive.