A kind of painting showing a bodhisattva guiding the soul of the dead appeared in the late Tang and the Five Dynasties at Dunhuang. In the paintings, the bodhisattva holds a soul-guiding flag to lead the dead to be reborn into heaven. This kind of Buddhist flags is a variation of the Confucian banners influenced by medieval Buddhism. During the Tang and Song dynasties Buddhist pennants and traditional Confucian banners evolved into the unique soul-guiding flags.