A major motivation for the introduction of Chinese characters into Korea was the spread of Buddhism. The major Chinese text that introduced Hanja to Koreans, however, was not a religious text but the Chinese text Cheonjamun (천자문; 千字文; Thousand Character Classic).
Although Koreans had to learn Classical Chinese to be properly literate for the most part, some additional systems were developed which used simplified forms of Chinese characters that phonetically transcribe Korean, including hyangchal (향찰; 鄕札), gugyeol (구결; 口訣), and idu (이두; 吏讀).
One way of adapting Hanja to write Korean in such systems (such as Gugyeol) was to represent native Korean grammatical particles and other words solely according to their pronunciation. For example, Gugyeol uses the characters 爲尼 to transcribe the Korean word "hăni", which in modern Korean means "does, and so". In Chinese, however, the same characters are read as the expression "wéi ní", meaning "becoming a nun". This is a typical example of Gugyeol words where the radical (爲) is read in Korean for its meaning (hă—"to do"), whereas the suffix 尼, ni (meaning "nun"), is used phonetically.
Hanja were the sole means of writing Korean until King Sejong the Great promoted the invention of Hangul in the 15th century. Even after the invention of Hangul, however, most Korean scholars continued to write in hanmun.
Hangul effectively replaced Hanja only in the 20th century. Since June 1949, Hanja have not officially been used in North Korea, and, in addition, all texts are now written horizontally instead of vertically. Many words borrowed from Chinese have also been replaced in the North with native Korean words. Nevertheless, a large number of Chinese-borrowed words are still widely used in the North (although written in Hangul), and Hanja still appear in special contexts, such as recent North Korean dictionaries. The replacement has been less total in South Korea where, although usage has declined over time, some Hanja remain in common usage in some contexts.