Izanagi (イザナギ) is a Shinto deity - a kami - co-creator of the world and Japan. His story is reported in the Kojiki and Nihon shoki, two collections dealing with the myth of the creation of the world.
The earth in the beginning was empty and "like a jellyfish in the sea". A male deity, Izanagi, and a female deity, Izanami, were given the task of shaping this primordial chaos and creating a world.
But in order to do this, they first had to create a solid ground. This they did by means of a spear called Amenonuhoko (天沼矛, the "Heavenly Spear") which they dipped into the ocean and waved around. The drops that fell from the spear formed the Japanese islands, beginning with Onogoro (磤馭慮, "first dry land").
After an unsuccessful experiment because it was Izanami who had initiated their union, the two kami gave birth to many other kami who gradually formed everything in nature: islands, mountains, rivers, wind, sand, etc.
But while she was giving birth to the fire kami, Kagutsuchi, Izanami was fatally burned and retired to the realm of the dead. Mad with rage, Izanagi decapitated Kagutsuchi (who was then only a newborn), the blood gave birth to eight new deities including Takemikazuchi and Futsunushi, and decided to go to join Izanami in the land of the dead, Yomi.
He managed to find Izanami, but she begged him not to look at her because she had to ask the permission to return to earth to the kami of the underworld first. But Izanagi's impatience was stronger and he managed to surprise his wife.
He was then horrified to see that her body had started to rot and spread a horrible smell. Izanami, humiliated and angry at being caught, went after Izanagi who was running away.
Izanagi managed to escape from her and sealed the entrance to the realm of the dead with a heavy stone. Izanami told him that she would kill a thousand of Izanagi's creations every day in revenge. But Izanagi replied that he would create one thousand five hundred, thus giving birth to the cycle of life and death.
Izanagi then went to purify himself at the mouth of the Tachibana River in Himuka (present-day Miyazaki Prefecture), and from the water washing his wounds came out other kami, including:
Thus, the Izanagi bath is considered in Shintoism as the foundation of harae, one of the most important purification practices.