The practice of hanami is many centuries old. The custom is said to have started during the Nara Period (710–794) when it was ume blossoms that people admired in the beginning. But by the Heian Period (794–1185), sakura came to attract more attention and hanami was synonymous with sakura. From then on, in tanka and haiku, "flowers" meant "sakura."
Hanami was first used as a term analogous to cherry blossom viewing in the Heian era novel Tale of Genji. Whilst a wisteria viewing party was also described, from this point on the terms "hanami" and "flower party" were only used to describe cherry blossom viewing.
Sakura originally was used to divine that year's harvest as well as announce the rice-planting season. People believed in kami inside the trees and made offerings. Afterwards, they partook of the offering with sake.
Emperor Saga of the Heian Period adopted this practice, and held flower-viewing parties with sake and feasts underneath the blossoming boughs of sakura trees in the Imperial Court in Kyoto. Poems would be written praising the delicate flowers, which were seen as a metaphor for life itself, luminous and beautiful yet fleeting and ephemeral. This was said to be the origin of hanami in Japan.
The custom was originally limited to the elite of the Imperial Court, but soon spread to samurai society and, by the Edo period, to the common people as well. Tokugawa Yoshimune planted areas of cherry blossom trees to encourage this. Under the sakura trees, people had lunch and drank sake in cheerful feasts.
Today, the Japanese people continue the tradition of hanami, gathering in great numbers wherever the flowering trees are found. Thousands of people fill the parks to hold feasts under the flowering trees, and sometimes these parties go on until late at night. In more than half of Japan, the cherry blossoming period coincides with the beginning of the scholastic and fiscal years, and so welcoming parties are often opened with hanami. The Japanese people continue the tradition of hanami by taking part in the processional walks through the parks. This is a form of retreat for contemplating and renewing their spirits.