The shakuhachi is said to have originated several thousand years ago in Central Asia It arrived Japan during the Nara Period after crossing over into China from India, together with Buddhism. Initially it was used as an instrument for playing traditional Japanese court music and ancient shakuhachis are kept at shrines and temples such as the Shosouin and Horyuji. These ancient shakuhachis are, however, different in length and shape compared to recent instruments. Eventually this flute became an instrument for those referred to as Zen and Fuke sect. These Buddhists roamed the country wearing a "amigasa" (braided hat) and playing their shakuhachi flute.