The term Gakumonryo is a scholarship for Monjosho (students who study poetry and history) who studied Kidendo (the study of history) at Daigaku-ryo (Bureau of Education under the ritsuryo system) during the Heian period and it was also called Kyuryo. Those who were granted Gakumonryo were called Kyuryo gakusei.
Based on the records in "Shoku Nihongi" (Chronicle of Japan Continued) dated on twenty-third day, twelfth month of the fourth year of Enryaku era (old calendar), its origin is believed to be fact that four persons including SUGAWARA no Kiyokimi, and SUGAWARA no Kiyotsuna, both were the sons of the late provincial governor of Totomi Province SUGAWARA no Furuhito, were granted Gakumonryo. However, the description is also seen in the above book saying Gakumonryo was granted in reward for their father Huruhito's achievement as Jidoku (imperial tutor) and none were rewarded thereafter. Therefore, it is said that the Sugawara clan, which later got the leading position in Kidendo, associated this historical fact with Gakumonryo of the mid-Heian period aiming to demonstrate the family's achievement at Daigaku-ryo.
Originally, Daigaku-ryo owned rice fields called kangakuden (gakuryoden) and it provided students with accommodation and meal using annual tax gained from such rice fields. Therefore, it is considered that there was no need to grant Gakumonryo separately during the era of the brothers of SUGAWARA no Kiyokimi.
However, after people involved in the assassination of FUJIWARA no Tanetsugu recovered their impaired reputation, confiscated territory of late Yakamochi OTOMO located in the Kaga Province, which accounted for the large portion of kangakuden, was returned to the Tomo clan (old Otomo clan) at the request of the then powerful figure in the bureaucracy TOMO no Yoshio. After TOMO no Yoshio was banished due to the Otenmon incident, the above territory was once again confiscated, but it was incorporated into Kokusoin (Grain warehouse), not Daigaku-ryo. As a result, a conflict occurred between Daigaku-ryo, which lost its financial base, and Kokusoin, which obtained new territory. Further, as influential clans like the Fujiwara clan started to support the students of the clan by establishing their own Daigaku-besso (academic facility for nobles), a kind of 'gap' was created between the students of influential clans who were supported by Daigaku-besso and students of other clans who lost the support of living. It was that time when Kiyoyuki MIYOSHI proposed the restoration of Kangakuden in his book "Iken Junikajo" (twelve opinions).
Although it is said that Kokumotsu-in was a kind of social welfare institution which was established in the Daido era (Japan) using Joheiso (Johei storehouse) of Tang Dynasty as a model, actually it assumed from the very beginning the role of generating slush money to finance naitei-hiyo (daily living and other expenses for the Imperial Family) which was deficient due to the decline of the Ritsuryo system (a system of centralized government based on the ritsuryo code). Under such circumstances, the Imperial court couldn't return the former kangakuden, which was then the territory of Kokuso-in, to Daigaku-ryo and intended to ease the dissatisfaction of Daigaku-ryo by getting Kokuso-in to grant Gakumonryo to selected students in return.
It was initially called toshokuryo/tsukiryo and it is said that either ONO no Yoshiki (880) ("Kokin Wakashu Mokuroku" (a list of Kokin Wakashu - A Collection of Ancient and Modern Japanese Poetry), TACHIBANA no Toshimichi (932) or SUGAWARA no Fumitoki (three year later) (Fujiwara no Tamekane's letter compiled in "Choya gunsai" - Collected Official and Unofficial Writings) was the first recipient. Recipients were called Kyuryo-gakusei and two were selected out of recommended or self appointed applicants of Monjosho through Shi-fu (examination) called Gakumonryoshi (a selection exam for the award of Gakumonryo) (Kyuryoshi - a selection exam for the award of Kyuryo) since the number of applicants usually exceeded the quota. Needless to say, many of the Monjosho wanted to become Kyuryo-gakusei and as a result, the most intelligent students were selected as recipients. Accordingly, kyuryo-gakusei were preferentially selected as Monjo tokugosho (Distinguished Scholars of Letters) and this examination became a gateway to the instructor of Daigakuryo or official post of Shikibu-sho (the Ministry of Ceremonies). Later, Kidendo became hereditary learning and instructors of Kidendo recommended their sons for Kyuryo gakusei in order to make heredity sure and as a result, it became difficult for the sons of families other than hereditary families to apply for the examination even though examinations were conducted.
In the meantime, some Daigaku-besso also established their own Gakumonryo system. As Daigaku-besso focused on supporting the study and living of the students of their families, Gakumonryo was granted in order to encourage these students. It is said that the first case of Gakumonryo granted by Daigaku-besso was the one granted by Kobun-in, which was established by WAKE no Hiroyo ("Nihon Koki" (Later Chronicle of Japan)). However, some people asserts that Kobun-in was a kind of library, not Daigaku-besso, and there is a possibility that WAKE no Hiroyo personally granted as the chief of the Wake clan.
Gakumonryo granted by Kangakuin, Daigaku-besso of the FUJIWARA clan, was particularly famous and Kyuryo-gakusei who were granted Gakumonryo were selected from the students of FUJIWARA clan. As the head of FUJIWARA clan assumed the position of the chief of Kangaku-in concurrently with Sekkan (regents and advisers) or Ichinokami (the ranking Council Member), Kyuryo-gakusei of Kangaku-in were regarded, thanks to the political power of the FUJIWARA clan, equally with Kokuso-in's Kyuryo-gakusei who were selected by Daigakuryo, though Daigakuryo denied it ostensively. Under such circumstances, students of the FUJIWARA clan opted to apply for Kangaku-in's Gakumonryo, which was easier to receive, and enjoyed the same social treatment with Daigakuryo's Kyuryo-gakusei. As a result, these students oppressed the students of other families and became the motive power to strengthen Fujiwara clan's reign over the bureaucracy.
In the late Heian period, however, not only examination, but also Gakumonryo itself became the nominal ones due to the decline of Daigakuryo as well as the decrease in the function of Kokuso-in.