Datong Huayan Temple (Huayan si), lying in the western part of town, got its name because it was, and remains, a major temple of the Huayan sect, a sub-category of the Buddhism popular in north China. This is the largest and most perfectly preserved temple of the Liao (916-1125) and Jin (1115-1234) dynasties in China, and it is easy to spend a day here, wandering about the halls and courtyards, admiring the architecture. The temple was originally built in the Liao Dynasty (916-1125 AD), as an ancestral temple to the imperial family, but it became an important Buddhist temple in the ensuing Jin Dynasty (1115-1234 AD). The temple saw the prosperity in the Yuan Dynasty (1271-1368 AD), when the large-scale renovation for the temple was completed. The large temple is divided into two parts. The Upper Temple has various halls, the largest of which is the Grand Hall (Daxiong baodian), otherwise known as the Mahavira Hall, which houses five large Ming Dynasty (1368-1644 AD) Buddhas, 26 guardians and numerous attractive murals. Surrounding the Grand Hall are other halls for other Buddhas, including a side hall dedicated to Ksitigarbha, the guardian of the earth who is known in China as Dizang. The Lower Temple is smaller than the upper, but has a lot of charm. The main room here, the Bojiajiaocang Hall (Baojiajiaocang baodian), contains some Liao Dynasty statues, and some heavenly deities, known in China as Tianwang.