Du Yu 杜宇 was one of the semi-mythological kings of the ancient state of Shu 蜀. Stories about his life are to be found in Chang Qu's 常璩 book Huayang guo zhi 華陽國志 that quotes from the geographical treatise Shuijingzhu 水經注, the chronicle Shuwang benji 蜀王本紀, and Lai Min's 來敏 (meanwhile lost) book Benshulun 本蜀論. Some stories are also to be found in the geography Taiping huanyu ji 太平寰宇記 and the fragmentarily transmitted texts Shisanzhou zhi 十三州志 and Qinjing 禽經 (a book on birds).
According to these stories, Du Yu hailed from Zhuti 朱提 (modern Zhaotong 昭通, Yunnan), where he is said to have fallen down from the sky, and married Liang Li 梁利 (also known as Zhu Li 朱利) from Jiangyuan 江源 (modern Chongzhou 崇州, Sichuan), where she had been born in a well. Du Yu's imperial title was Emperor Wang Di 望帝, and his residence during his more than a hundred-years-long reign was in Pi 郫 (west of modern Chengdu).
Legend says he instructed the people of Ba 巴 and Shu how to plough the fields. His counsellor Bie Ling 鱉靈 (also written 鱉冷, later known as King Kai Ming 開明) once tamed the floods, similar to Yu the Great 大禹, of a river at Mt. Yushan 玉山. Du Yu therefore decided to retire and to cede the throne to Bie Ling. Bie Ling came from the region of Jing 荆 (modern Hubei), where he died and his corpse disappeared. It later reappeared at the bankds of a river near Pi, was revived, and Bie Ling had an audience with Wang Di.
The book Shuwang benji says that Du Yu once had an affair with Bie Ling's wife, but later repented his misdoing and decided to retire because of his moral inferiority. After retirement, Du Yu lived deep in the mountains. His soul is believed to have transformed into a cuckoo (dujuan 杜鵑, formerly also known with the names zijuan 子鵑, zigui 子規, zigui 子䳏, zijuan 子嶲 or zigui 姊歸). The bird's appearance in spring has the aim to remind the people beginning with their work on the fields.
Another story says that Bie Ling usurped the throne, and the transformation into a bird was the result of Du Yu's unsuccessful attempt at getting back the throne. The cuckoo is also known with the name duyu 杜宇. In Sichuan, "Lord Du" 杜主君 was known as the god of agriculture, similar to Shen Nong 神農 in the Central Plain.
There is yet another story reporting Du Yu's fight with an evil dragon of Minjiang River 岷江 who held the Dragon Maid (Long Mei 龍妹) prisoner. Du Yu freed the girl, tamed the waters of River Min, and married her. Later Du Yu was incarcerated by one of his own trusted ministers who wanted to make the Dragon Maid his own wife. Du Yu died in the mountain prison and transformed into a cuckoo, returning to the palace, where his wife also took the shape of a bird.