The yuefu 乐府 "[songs of the] Music Bureau" is a poetic genre prevalent during the Han period 汉 (206 BC-220 CE). In this narrow sense it is called Han yuefu 汉乐府. It introduced both a new kind of shape (five-syllable verses) and new contents at a social and often very personal level into Chinese poetry. The yuefu was so popular that Han period yuefu were imitated by later poets until the mid-Tang period 唐 (618-907). The term Han yuefu often includes ancient, i. e. anonymous songs (gushi 古诗) from the Han period which are, from the origin and the content, actually no yuefu songs. Examples of these songs can be found in the collection Gushi shijiu shou 古诗十九首.

The Music Bureau was a Han period central government institution collecting and administrating music needed by the court at special occasions, like sacrifices, inspection tours, court ceremonies, bankets or archery contests. It was established during the reign of Emperor Wu 汉武帝 (r. 141-87 BCE), probably already under Emperor Hui 汉惠帝 (r. 195-188 BC) with the appointment of a Grand Director of Music (taiyueling 太乐令). During the early decades of the Han dynasty the court either used melodies and chants from the Qin dynasty 秦 (221-206 BC) of songs from the ancient kingdom of Chu 楚 in southern China. Emperor Wu, in the course of his general reform and standardization of the state administration, established the Music Bureau. This bureau defined 19 chants for the state offerings (Han jiaosi ge shijiu zhang 汉郊祀歌十九章). These had to be rubberstamped by members of the Confucian department of the National University (taixue 太学). Text and melody were refined by Li Yannian 李延年, his sister, Lady Li 李夫人, and her team of dancers, and the writer Sima Xiangru 司马相如. This new type of song (xinsheng qu 新声曲) laid stress on state offerings, the service of the dynasty to Heaven and Earth and the incovation of felicity and good omina, and less on the veneration of the imperial ancestors. Emperor Wu had thus reformed the ancient odes and hymns used at the royal courts during the Western Zhou 西周 (11th cent.-770 BCE) and Warring States 战国 (5th cent.-221 BCE) periods. The performance of music was so important that at the end of the Former Han period 前汉 (206 BCE-8 CE) the court employed almost a thousand female dancers for various occasions. While the Director of Music was concerned with sacrificial court music, the Music Bureau had to manage the other types of music. While the sacrificial music was very refined and written in an antique style (the so-called "elegant music" yayue 雅乐), people preferred a more fresh and familiar style for other occasions (suqu xinsheng 俗曲新声). Emperor Ai 汉哀帝 (r. 7-1 BCE) therefore suspended the work of the Music Bureau.

At the beginning of the Later Han period 后汉 (25-220 CE) Confucianism was less strong because it had divided into several contending branches. It lost therefore its influence on the music sponsored by the court. Five-syllable poems (wuyan shi 五言诗) had won over the old four-syllable verses (siyan shi 四言诗). The organisation of the court music was restructured. Offerings and official banquets were arranged by the Grand Director who was subject to the Chamberlain for Ceremonials (taichang qing 太常卿), while all other musical events were laid into the hands of the Director of Palace Entertainments (chenghualing 承华令) who was subject to the Chamberlain for the Palace Revenues (shaofu 少府). The Bureau was now also responsible for the active collection of songs from among the population. This decision was not an expression of benevolence towards the people but had to do with the popularity of the apocryphal interpretation of the Confucian Classics. This branch of Confucianism expected portents and omina appearing all over the country, and also in the voice of the people. Their songs therefore could be a help for a better government.

At the end of the Former Han period, the Music Bureau had collected 314 songs from all over the country, of which actually only 55 were really songs from the people and not court hymns for sacrifices. During the Later Han period it was also local officials that sponsored the composition and collection of yuefu songs. Two traditions of yuefu had thus come into being, the one consisting of songs collected by the court and officially recorded in imperial bibliographies. A list can be found in the treatise on music in the official dynastic history Songshu 宋书 (19-22 Yue zhi 乐志). The others were circulating among the population or the local gentry and was only occasionally recorded so that these songs were dispersed in various writings. The earliest collections came up in the 6th century, the Yutai xinyong 玉台新咏. The first comprehensive collection of Han yuefu is the Yuefu shiji 乐府诗集 from the Song period 宋 (960-1279). This collection is also the first attempt to categorize yuefu songs according to use, content and the musical keys of modes. Jiaomiao ge 郊庙歌 "Temple songs", Guchui qu 鼓吹曲 "Drum-and-pipe melodies" and Wuqu 舞曲 "Dances" were court songs, but the Guchui type also includes songs from among the people, which are otherwise found in the categories Xianghe qu 相和曲 "Joint harmony melodies" and Zaqu 杂曲 "Miscellaneous melodies". The court songs can compared with the old hymns (song 颂) of the Shijing 诗经, the popular songs with the feng 风 category in this Confucian Classic. The popular song is called geyao 歌谣, and it is often subsumed unter the term yuefu. Both the musical compositions used by the court as well as popular songs were anonymous, at least during the Han period. Only very few authors of Han yuefu are known, like Xin Yannian 辛延年 (song Yulin lang 羽林郎), Song Zihou 宋子侯 (Dong Jiaorao 董娇娆) or Li Yannian 李延年 (Beifang you jiaren 北方有佳人).

Together with the yuefu songs from the Later Han period, more than 100 Han period yuefu are surviving. They are to be found in various texts, from the treatises on music in the official dynastic histories Hanshu 汉书 and Houhanshu 后汉书 and the literary anthologies Wenxuan 文选 and Yutai xinyong. The whole corpus of yuefu songs, from the Han period to the Tang, has been assembled in the Song period collection Yuefu shiji.

Han period yuefu songs are to a great extent songs with a deep emotional content, describing the suffering of people of all social backgrounds. Part of them even includes a direct critique towards the social conditions under which the people lived during that time. Soldiers, husbands and wives, orphans, widows, retainers of betrayed nobles, girls forced into marriage are the themes prevalent in a large part of Han period yuefu poems. To this category belong the famous songs Dongmen xing 东门行 "The eastern gate", Guer xing 孤儿行 "The orphan", Fubing xing 妇病行 "A wife was sick", Zhan cheng nan 战城南 "Battling south of the ramparts", Shiwu congjun zheng 十五从军征 "Aged fifteen I went to war", Yinma changcheng ku xing 饮马长城窟行 "Watering horses at the breech on the Great Wall", Shanshang cai miwu 上山采蘼芜 "Plucking orchids on the mountain", Yuan ge xing 怨歌行 "A song of sorrow", You suo si 有所思 "There is someone I think of", or Shang xie 上邪 "Heaven, alas!". The song Mo shang sang 陌上桑 "Mulberry trees on the waterside" is a kind of pastourella in which a wife from the nobility renounces the avances of another nobleman. The ballad Kongque dongnan fei 孔雀东南飞 "Phoenix flies to the southeast" describes the tragic love between Liu Lanzhi 刘兰芝 and Jiao Zhongqing 焦仲卿 that are both forced to marry someone else.

Some yuefu poems like Mingji 鸡鸣, Xiangfeng xing 相逢行 or Chang'an you xia xie xing 长安有狭斜行 describe the fight for power of some rival families and the prodigity of their lifes in contrast to the simple life of the peasants and the lower gentry. The poems Huainan minge 淮南民歌 and Wei Huanghou ge 卫皇后歌 are a direct critiques towards the imperial house, while Laoshi ge 牢石歌 describes the intrigues of court cliques, and Wuhou ge 五侯歌 describes the extravagance of the higher nobility. These poems still stand in the tradition of many feng songs of the Shijing.
Morally correct behaviour of women is the theme of the poems Mo shang sang, Yulin lang, Longxi xing 陇西行 and Shang shan cai miwu. In many situations a women laments about separation from her husband, or about his infidelity, like in Quche shang dongmen xing 驱车上东门行, Ranran gu sheng zhu 冉冉孤生竹, Qingqing ling shang bo 青青陵上柏, Gu ge 古歌, Yinma changcheng xing, Yan ge xing or Gao tian zhong xiao mai 高田种小麦.

General worldly wisdom is the content of Chang ge xing 长歌行, Meng hu xing 猛虎行 and Ku yu guo he qi 枯鱼过河泣.

Yet not all songs have a sad and desparate mood. There are also yuefu songs praising competent officials and ideal conditions, like Yanmen taishou xing 雁门太守行, Jiangnan 江南 or Cheng zhong yao 城中谣.

Some features of the yuefu are very similar to the feng style poems in the Shijing, like the anacrusis of a poem (xing 兴) in the shape of a picture from nature, like reed, trees on a hill, grass on the banks of a river, with a subsequent and often immediate transition to the personal feelings of the lyrical ego. While the Shijing songs have a kind of refrain and the stanzas are very repetitive, yuefu songs are much more narrative and connected with a concrete personal situation. They are less general – and thus prone to a Confucian interpretation as general description of conduct – but often very concrete descriptions of a personal experience, some of which appear like factual incidents. Allegorical images from nature often serve as stylistic devices, referring to birds or trees. Dialogues are also often involved. The individuals described in the yuefu are very strong personalities, especially the women, like Qin Luofu 秦罗敷 who resists the immoral offers of another nobelman (or, jokingly, her own husband?), Miss Hu 胡姬 who criticises the retainers of the Huo 霍 family, or poor Dong Jiaorao 董娇娆.