Chinese characters first came to Japan on articles imported from China. An early instance of such an import was a gold seal given by the emperor of the Eastern Han Dynasty in 57 AD. It is not clear when Japanese people started to gain a command of Classical Chinese by themselves. The first Japanese documents were probably written by Chinese immigrants. For example, the diplomatic correspondence from King Bu of Wa to Emperor Shun of the Liu Song Dynasty in 478 has been praised for its skillful use of allusion. Later, groups of people called fuhito were organized under the monarch to read and write Classical Chinese. From the 6th century onwards, Chinese documents written in Japan tended to show interference from Japanese, suggesting the wide acceptance of Chinese characters in Japan.
The Japanese language itself had no written form at the time kanji were introduced. Originally texts were written in the Chinese language and would have been read as such. Over time, however, a system known as kanbun emerged, which involved using Chinese text with diacritical marks to allow Japanese speakers to restructure and read Chinese sentences, by changing word order and adding particles and verb endings, in accordance with the rules of Japanese grammar.
Chinese characters also came to be used to write Japanese words, resulting in the modern kana syllabaries. A writing system called man'yogana (used in the ancient poetry anthology Man'yoshu) evolved that used a limited set of Chinese characters for their sound, rather than for their meaning. Man'yogana written in cursive style became hiragana, a writing system that was accessible to women (who were denied higher education). Major works of Heian era literature by women were written in hiragana. Katakana emerged via a parallel path: monastery students simplified man'yogana to a single constituent element. Thus the two other writing systems, hiragana and katakana, referred to collectively as kana, are actually descended from kanji.
In modern Japanese, kanji are used to write parts of the language such as nouns, adjective stems and verb stems, while hiragana are used to write inflected verb and adjective endings (okurigana), particles, native Japanese words, and words where the kanji is too difficult to read or remember. Katakana is used for representing onomatopoeia, non-Japanese loanwords, and for emphasis on certain words. - from wikipedia