The Grotto of the General, or the Temple of the General, is two kilometers northwest of Xiaguan, near Dali. It was built during the Ming Dynasty and occupies 0.67 hectare. It is composed of the Gate Tower, the Bazi Building and the Main Hall. The temple is now part of the Cangshan Park. It was built for the Tang Dynasty General Li Mi, who was sent to occupy Nanzhao in 754, or the 13th year of the reign of Tang Emperor Tianbao. The General drowned himself in a nearby river after his army was destroyed. A legend says that the local people built this temple to worship his stature.