Hanami was first used as a term analogous to cherry blossom viewing in the Heian era novel The Tale of Genji.
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.