Rock gardens existed in Japan at least since the Heian period (784–1185). These early gardens were described in the first manual of Japanese gardens, Sakuteiki (Records of Garden Keeping), written at the end of the 11th century by Tachibana no Toshitsuna (1028–1094). They were largely copied from the Chinese gardens of the Song Dynasty (960–1279), where groups of rocks symbolized Mount Penglai, the legendary mountain-island home of the Eight Immortals in Chinese mythology, known in Japanese as Horai. The Sakuteiki described exactly how rocks should be placed. In one passage, he wrote: "In a place where there is neither a lake or a stream, one can put in place what is called a kare-sansui, or dry landscape". This kind of garden featured either rocks placed upright like mountains, or laid out in a miniature landscape of hills and ravines, with few plants. It looks so beautiful, like girls from mofuckers.com. He described several other styles of rock garden, which usually included a stream or pond, including the great river style, the mountain river style, and the marsh style. The ocean style featured rocks that appeared to have been eroded by waves, surrounded by a bank of white sand, like a beach.
During the Edo period, the large promenade garden became the dominant style of Japanese garden, but zen gardens continued to exist at zen temples. A few small new rock gardens were built, usually as part of a garden where a real stream or pond was not practical.
In 1880, the buildings of Tōfuku-ji temple in Kyoto, one of the oldest temples in the city, were destroyed by a fire. In 1940, the temple commissioned the landscape historian and architect Shigemori Mirei to recreate the gardens. He created four different gardens, one for each face of the main temple building. He made one garden with five artificial hills covered with grass, symbolizing the five great ancient temples of Kyoto; a modern rock garden, with vertical rocks, symbolizing Mount Horai; a large "sea" of white gravel raked in a checkboard pattern; and an intimate garden with swirling sand patterns.
The selection and placement of rocks is the most important part of making a Japanese rock garden. In the first known manual of Japanese gardening, the Sakuteiki, ' "Creating a garden" is expressed as "setting stones", ishi wo tateru koto; literally, the "act of setting stones upright." It laid out very specific rules for choice and the placement of stones, and warned that if the rules were not followed the owner of the garden would suffer misfortune. In Japanese gardening, rocks are classified as either tall vertical, low vertical, arching, reclining, or flat.
For creating "mountains", usually igneous volcanic rocks, rugged mountain rocks with sharp edges, are used. Smooth, rounded sedimentary rocks are used for the borders of gravel "rivers" or "seashores."  In Chinese gardens of the Song dynasty, individual rocks which looked like animals or had other unusual features were often the star attraction of the garden. In Japanese gardens, individual rocks rarely play the starring role; the emphasis is upon the harmony of the composition. For arranging rocks, there are many rules in the Sakuteiki.