Chinese historical records, like Spring and Autumn Annals of Wu and Yue, the Bibliographies in the Book of the Han Dynasty, the Records of the Grand Historian, and other sources document the existence of martial arts in China since thousands years ago. For example, the Chinese martial art of wrestling, Shuai Jiao, predates the establishment of Shaolin temple by centuries. The establishment of Shaolin kung fu is, however, the most important one of these stories. Since Chinese monasteries were large landed estates, sources of considerable regular income, monks required protection. Historical discoveries indicate that, even before the establishment of Shaolin temple, monks have had arms and have also practiced martial arts.
In 495 AD, Shaolin temple was built in the Song mountain, Henan province. The first monk who preached Buddhism there was the Indian monk Buddhabhadra (佛陀跋陀罗; fo tuo ba tuo luo), simply called Batuo (跋陀) by the Chinese. There are historical records that Batuo’s first Chinese disciples, Huiguang (慧光) and Sengchou (僧稠), both had exceptional martial art skills. For example, Sengchou’s skill with the tin staff is even documented in the Chinese Buddhist canon. After Batuo, another Indian monk, Bodhidarma (菩提达摩; pu ti da mo), simply called Damo (达摩) by the Chinese, came to Shaolin in 527 AD. His Chinese disciple, Huike (慧可), was also a highly trained martial arts expert. There is implications that these first three Chinese Shaolin monks, Huiguang, Sengchou, and Huike, may have been military men before entering the monastic life.
Myth almost always comes with reality in the whole history of Shaolin and its kung fu. A popular myth is that it was Bodhidharma that first created Shaolin kung fu. Indeed, Shaolin monks knew martial arts even before Bodhidharma. Besides, no historical record mentions Bodhidharma as a practitioner of martial arts. Like other myths of Shaolin, this myth  has, after all, some roots in reality. Bodhidharma was the founder of Chan Buddhism. This made the concept of martial arts part of Chan Buddhism. This was the birth point of religious martial arts, a unique style which was the first institutionalized style of kung fu.