Shogakuin was one of the Daigaku-besso in the Heian period. Daigaku-besso were the academic facilities for nobles in the Heian period.
Shogakuin was established by ARIWARA no Yukihira in 881. It was located at Sakyo Sanjo to the south of Daigaku-ryo (the government facility to educate students who would later become bureaucrats) and to the west of Kangakuin (the Fujiwara family's academic facility), and the address is now Nishinokyo Nansei-cho, Nakagyo-ku Ward, Kyoto City, Kyoto Prefecture. Sons of the Imperial Family members, local lords, and clans descended from the Imperial families (the Minamoto clan, the Taira clan, and Ariwara clan, and so on) lived in Shogakuin to attend classes at Daigaku-ryo. It was officially recognized as Daigaku-ryo Nanso (one of the Daigaku-besso located to the south of Daigaku-ryo) in 900, and was called 'Nanso no Niso' (two academies to the south) along with Kangakuin. Shogakuin had official posts such as Betto (the principal) and Gakuto (the top student) following the example of Kangakuin. The Daigakubesso lost their power as the strength of the aristocracy waned. In the twelfth century, at the end of the Heian period, Shogakuin declined along with other Daigaku-besso.
After that, only the Shogakuin Bettoshoku (office of the Betto of Shogakuin) survived as an honorary post. It became a customary practice that Genji choja (the top of the Minamoto clan) took the office as an additional post, and eventually members of the Murakami-Genji (Minamoto clan) held Shogakuin Bettoshoku and Junnain (the detached palace of Emperor Junna) Bettoshoku by succession. Later Yoshimitsu ASHIKAGA became the first Genji Choja as Seiwa-Genji (Minamoto clan) to succeed the Bettoshoku of both Shogakuin and Junnain, and after that Seii taishogun (literally, "great general who subdues the barbarians") of the Ashikaga clan (shogun family in the Muromachi period) became Genji Choja many times, holding both of these offices. Ieyasu TOKUGAWA, the founder of the Tokugawa Shogunate, followed suit, and each successive shogun became Genji Choja except for Hidetada TOKUGAWA and succeeded to the offices of Shogakuin Bettoshoku and Junnain Bettoshoku until the end of the Edo period.