The history of Chinese opera can be traced back to the Three Kingdoms Period (A.D. 220–265), when a form of opera called Canjun was popular among the general public. Chinese opera became more formalized during the Tang Dynasty (A.D. 618–907), under Emperor Li Longji (reigned A.D. 712–756). Emperor Li Longji founded the first known opera troupe in China — the "Pear Garden" — and today's opera professionals are still referred to as "Disciples of the Pear Garden".
Many regional opera forms in modern China draw on a tradition extending at least as far back as the twelfth century A.D., when opera was performed in the large public theatres of Hangzhou, capital of the Southern Song Dynasty (A.D. 1179–1276). The most popular form at the time was nanxi (literally "Southern drama"), characterized by sung or spoken dialogue written largely in rhyme.
Beginning in the thirteenth century A.D., a northern form of opera called Yuan Zaju — which was usually divided into four acts — developed into a sophisticated theatrical style and gained prominence. Yuan Zaju differed from the Nanxi style in that the main character sang a solo using a single major rhyming scheme, while all other characters spoke their lines. Zaju typically featured three major roles: a woman (dan); an older, usually venerable, man (mo); and a young man (sheng). Comic roles (chou) also played a part, providing ironic commentary on the events taking place. Yuan Zaju used mime, makeup, costumes, roles — all of the ingredients, in fact, which characterized the southern Nanxi style.
Meanwhile, the chuanqi ("marvelous tales") folk opera tradition flourished in the south, particularly in the provinces of Zhejiang and Jiangsu. One of China's finest operas— Gao Ming's The Lute Song — comes out of the Chuanqi tradition.
During the sixteenth century, Kunqu Opera — a form which originated in Kunshan near Suzhou City in Jiangsu Province — began to dominate Chinese opera. Characterized by soft singing and minimal musical accompaniment — typically only a drum or clapper and a bamboo flute — Kunqu rose to the status of national opera during the seventeenth and eighteenth centuries. Kunqu playwrights focused on prosody and novelty of expression, producing increasingly ornate operas which were often based on folktales and classical literature.
During the late eighteenth century, Beijing Opera was born when the Four Great Anhui Troupes came to Beijing in 1790. Originally staged for the imperial family, Beijing Opera would eventually become accessible to the general public. In 1828, some famous players from the Hubei Troupe came to Beijing, and Hubei and Anhui troupes often performed together on the same stage. This artistic collaboration gradually led to the mainstream melodies of Beijing Opera. It was a form of entertainment enjoyed by people from all walks of life, from high-ranking government officials to villagers. There are thousands of operas in the Beijing style, featuring stories drawn from China's literature and history.
During the Cultural Revolution (1966–1976), Beijing Opera suffered along with the other performing arts in China. Anything reflecting earlier Chinese society was banned. The famous Eight Model Plays — which depicted Communist activities during the war with Japan and the civil war with the Nationalists, as well as the class struggles that followed the founding of the People's Republic of China — were developed during this time. Although class struggle was the theme of most of these plays, some new forms of stage performance were also introduced. Many of those who grew up during the Cultural Revolution still favour music and singing from the Eight Model Plays. Traditional Beijing Opera was not performed again until 1978.