Gagaku was developed as court music of the Kyoto Imperial Palace, and its near-current form was established in the Heian period (794–1185) around the 10th century.
By the 7th century, the koto (the 13-stringed zither) and the biwa (a short-necked lute) had been introduced into Japan from China.
The form of gagaku was almost completed by the fusion of Tōgaku, Komagaku, Tenjikugaku and Rinyūgaku which were introduced from Asian countries, with Kuniburi no utamai, traditional Japanese music, and utaimono, songs born in the Heian period.
During the Kamakura period, military rule was imposed and gagaku was rarely performed at court.
After the Meiji Restoration of 1868, musicians from all three guilds came to the capital and their descendants make up most of the current Tokyo Imperial Palace Music Department.
By that time, the present ensemble composition had been established, consisting of three wind instruments – hichiriki, ryūteki, and shō (bamboo mouth organ used to provide harmony) – and three percussion instruments – kakko (small drum), shōko (metal percussion), and taiko (drum) or dadaiko (large drum), supplemented by two string instruments – gakubiwa and gakusō.
This subgenre of contemporary works for gagaku instruments, which began in the 1960s, is called reigaku (伶楽).
Most notable among these are Henry Cowell (Ongaku, 1957), La Monte Young (numerous works of drone music,[11] but especially Trio for Strings, 1958), Alan Hovhaness (numerous works), Olivier Messiaen (Sept haïkaï, 1962), Lou Harrison (Pacifika Rondo, 1963), Benjamin Britten (Curlew River, 1964), Bengt Hambraeus (Shogaku, from Tre Pezzi per Organo, 1967), Ákos Nagy (Veiled wince flute quartet 2010), Jarosław Kapuściński (numerous works), Sarah Peebles (numerous works), Michiko Toyama (Waka, 1960), and Tim Hecker (Konoyo, 2018).
The American poet Steve Richmond developed a unique style based on the rhythms of gagaku.
In a 2009 interview with writer Ben Pleasants, Richmond claimed he had written an estimated 8,000–9,000 gagaku poems.