In the Dali region, almost every village has a temple and almost every temple has a statue of Guanyin, the 'Goddess of Mercy'. Indeed, besides Benzhu worship, veneration of Guanyin is one of the striking aspects of Bai religious life.
Buddhism in the Dali region dates back to the Nanzhao, the empire emerging in the 8th century AD from six smaller fiefdoms in the Erhai area. As Nanzhao grew and rose to to rival both Tang dynasty China and the Tibetan Tubo empire, Tibetan, Chinese, Indian (see Liebenthal 1947) and Southeast Asia Buddhist influences merged with local religion to form a unique form of esoteric Buddhism called Azhali 阿吒力.
The exact form of how Buddhism became the prevalent religion cannot be established, but according to the 'Unofficial History of Nanzhao' 南诏野史 in 714 an emissary from Nanzhao to the Tang court brought back a number of Buddhist statues and thus started Buddhism in the Dali region. Other sources place the beginning of Buddhism in Yunnan even earlier. The important scroll, first completed in 899, called 南诏图传, or ‘Nanzhao History in Pictures', narrates the story that an Indian monk (in fact an appearance of Guanyin) makes a prediction to the founders of Nanzhao.
Several key events during the 9th century made Buddhism in Nanzhao prevalent. In 832 Nanzhao raided Chengdu, abducting a large number of skilled craftspeople to the Erhai region. In 839 Buddhism was outlawed in Tibet, forcing many Tibetan and Indian Buddhist monks to flee into adjacent areas, the Indian influence on Nanzhao being visible in the many Sanskrit inscriptions that have been unearthed. In 845 esoteric Buddhism was briefly outlawed in Tang China, closing many monasteries and forcing monks to seek refuge in neighbouring areas.
What sets the Buddhism in Nanzhao apart from Buddhism in China and Tibet is that it manifests itself largely as worship of Guanyin 观音, the 'Goddess of Mercy'. Like other Bodhisattvas, Guanyin was originally depicted male, but during the Tang dynasty she became to be depicted with female characteristics, a development that continued into the Song dynasty and beyond.
Guanyin is depicted in many different ways, but one style is unique to the Dali area where she is shown in the Acuoye 阿嵯耶 style: a tall, slender male figure in fine robes, the upper body exposed, barefoot and wearing a crown in which Amitabha Buddha sits. A large golden statue in this style was recovered from the Three Pagodas during restoration work in the 20th century. The 南诏图传 has several images of Guanyin in the Acuoye style (but some researches suggest that the extant copy, made in the 13th century, substituted the then popular Guanyin image for the original, see Chapin 1944, p 160.)
But generally, particularly from the Song dynasty onwards, Guanyin in depicted as female, a benevolent being gazing down upon the earth, often holding a jar of pure water and a willow branch. Guanyin is also often depicted holding an infant. In her crown is usually the image of Amitabha.
There are several stories to illustrate Guanyin's status as protector of the Dali area.
One story goes that once upon a time there was an evil demon Luocha 罗刹 (the name derives from a Hindu name for demon) that was terrorizing the Dali area, eating people's eyes. Guanyin, in the form of a wandering monk, arrives and befriends the demon. After a while the demon wants to do Guanyin a favour, and Guanyin cunningly only asks for some land just the size of his robe and as far as his dog can jump. The demon agrees, but Guanyin exercises his magic and throws his robes all over the Erhai and Cangshan, while the dog jumps all the way from Xiaguan to Shangguan. The demon want to renege on his promise, but Guanyin once again uses magic to entomb him in a cave at 上阳溪 village, where today there still is the Luocha Pavillion 罗刹阁 in front of the Luocha Cave 罗刹洞.