The Early Ninja:
Based on the accounts of Japanese folklore, the Ninja was descended from a demon that was half man and half crow. Romantic though this may be, it seems more likely that the Ninja evolved as an opposing force to the Samurai, their upper class contemporaries. Almost all reputable sources tell us that the skills that became ninjutsu, the ninja's art of stealth and invisibility, were developed between 600-900 A.D. By the year 850 A. D. the Tang Dynasty in China was collapsing. It fell in 907, and plunged China into half a century years of chaos. The fall of the Tang Dynasty caused some Tang generals to escape across the sea to Japan.
These Chinese commanders brought new battle techniques and philosophies of war with them to Japan. Then, in the 1020s, Chinese monks also began to arrive in Japan. These monks brought new medicines and fighting practices of their own. It is interesting to note that many of these ideas first originated in India, and later made their way across Tibet and China, before showing up in Japan.
The Chinese monks taught their methods of warfare to Japan's warrior monks, or yamabushi, and to members of the early ninja clans, as well.