In the Han Dynasty (206 BC-AD 220), historians Sima Qian and Ban Gu both included reports on ningxing, the emperors' male concubines. From these, Pan concludes that almost every emperor during the Western Han Dynasty (206 BC-AD 24) had or was suspected of having male partners.
The best known among these was Dong Xian.
It is said that Emperor Ai woke up to find the sleeves of his imperial robes tucked under the sleeping body of his partner Dong Xian. Not wanting to wake his beloved concubine, Ai sliced off his sleeves, and hurried off to his day's routine.
From then on, same-sex love between males has often been referred to as the "sleeve-slicing affection" - a euphemism for a gay relationship by those who still find it embarrassing to publicly address the topic.
By the Jin Dynasty (1115-1234), homosexuality had become a common practice among the upper classes and is frequently mentioned in official reports.
Pan says this is understandable as the Jin was one of few eras in world history when men were particularly attentive about their appearance. Pan says the other period was in Ancient Greece, where pederasty was an accepted part of life.
"Ancient Greek philosophers viewed homosexuality as more sacred than heterosexuality Without relevant literary references, we can't tell whether ancient people thought the same way, but it's obvious homosexuality during this time was free from excessive social prejudice and moral condemnation," Pan says.
In China, soon after the Sui Dynasty (AD 581-618), homosexuality gradually disappears from official records and Pan refers to novels and other casual references, the authenticity of which was often in doubt.
This situation extended through the Tang (AD 618-907) to Yuan (1271-1368) dynasties. Homosexuality seems to have resurfaced only in the Ming (1368-1644) and Qing (1644-1911) dynasties, but it was a very different scenario.
Homosexuality is frequently mentioned in the works of established writers such as the scholar Ji Yun and poet Yuan Mei.
In novelist Cao Xueqin's classic A Dream of Red Mansions, at least three male characters are explicitly portrayed as having homosexual leanings.
It was also in the Qing Dynasty that China's first homosexual novel was published, Pinhua Baojian (Treasury of Flower Appreciation).
During this time, trends shifted, and it became known as the "southern fashion", a homophonic pun on "south" and "man", as homosexuality became more common in the southern provinces of Guangdong and Fujian.
But female homosexuality, for the first time, became publicly recognized for what it was.
It was said in Guangzhou and neighboring counties that it was acceptable for female couples to move in together, and stay unmarried their whole lives.
During the Qing Dynasty, the so-called "private residence" business developed.
After an anti-prostitution policy banned troupes from employing female musicians, male opera singers started singing female roles.
While performing on private occasions, some of these good-looking actors, known as xianggong, offered off-stage services to their male patrons.
But they did not escape social prejudice.
According to Pan, the xianggong had to resort to prostituting themselves because of their inferior social status.
But whereas female prostitutes often had a second chance at a normal life after they gave up their trade, xianggong suffered from social stigma all their lives. Their descendants were even banned from sitting for the imperial civil examinations.
In Qing Dynasty folklore, there is a deity who looks after homosexuals. This was the famous "rabbit god", known as Hu Tianbao, a man who had been killed for stalking a handsome official.
In hell, he was laughed at, but to show that they sympathized, the gods of hell appointed him the guardian god of same-sex lovers.
This was more than an amusing anecdote, for it reflected the prevalent social attitude at that time towards homosexuality.
Chinese sociologist Li Yinhe calls social tolerance China's "cultural advantage".
In an article she wrote on how "China had been ahead in the acceptance of homosexuality but had fallen behind again", Li notes that China had, in the past, treated homosexuals with more tolerance than some Western societies which had persecuted them, sometimes to death.
She feels that the culturally confident Chinese were not afraid of accepting an alternative lifestyle, but that they would rather ignore it than oppose it.
But, Li adds, tolerance does not mean full acceptance.
Contact the writer at
hanbingbin@chinadaily.com.cn.