It was one of the last meals of Wen Tianxiang (文天祥), a politician in the Southern Song dynasty (南宋) (1127–1279) who was captured by the invading Yuan (元) armies of Kublai Khan. Before he was executed in 1283, an old lady visited the prisoner-of-war to honour him with a chicken that she cooked with just a cup of Chinese wine, a cup of soy sauce and a cup of cooking oil. Thus, the dish was named by the prison guards as三杯鸡, which literally means “three cups chicken”. After his death, the guards, who regarded Wen as a righteous hero, honoured him by cooking the dish on the 9th day of the 9th lunar month every year.
Wen famously wrote the poems Song of Righteousness (正气歌) and Passing Lingdingyang (过零丁洋). The latter has a line, “人生自古誰無死，留取丹心照汗青” (All men are mortal, but my loyalty will illuminate the annals of history forever) which is still widely quoted today. The dish has since gained a permanent spot at the dinner tables of the Taiwanese, who added basil leaves and used sesame oil instead.