Halfway up a sheer cliff in Shanxi Province, about 75 metres (246 ft) above the floor of Jinxia Gorge, a cluster of wooden halls clings to the rock. This is the Hanging Temple, or Xuankong Temple (悬空寺, Xuánkōng Sì), one of the most astonishing religious buildings in China and a landmark of Mount Heng, the Taoist sacred mountain of the north.

The Hanging Temple’s wooden galleries on the cliff of Jinxia Gorge near Datong

Where is the Hanging Temple?

The temple stands in Hunyuan County, part of Datong City in northern Shanxi, on the west side of Jinxia Gorge beneath the summit of Mount Heng (Hengshan). Datong lies about 64 km (40 miles) away, and the city is the usual base for a visit. The temple is one of the two headline sights of the Datong area, together with the Buddhist cave sculptures of the Yungang Grottoes.

You will see it under several names: Hanging Temple, Hanging Monastery, Hengshan Hanging Temple and Xuankong Temple. They all refer to the same building.

Decorated roofs and balconies of Xuankong Temple attached to the rock face

History: a temple founded in the 6th century

Tradition credits the founding to a monk named Liaoran, with construction said to have begun in 491 AD, during the Northern Wei period. That makes the site more than 1,500 years old. The buildings visitors see today are the result of many centuries of rebuilding and repair; the clay statues in the Sanguan Hall, for example, date from the Ming dynasty.

A building in such a position needs constant care. In September 2015 China’s cultural heritage administration approved a project to restore the temple’s paintings and oil decorations, followed by an overhaul of the scenic area, and the temple reopened to the public in May 2016.

How the Hanging Temple stays on the cliff

The slender wooden poles under the galleries are the most photographed detail, but the real strength lies inside the mountain. Oak crossbeams are fitted into holes chiselled deep into the cliff, so the main supporting structure is hidden in the bedrock. Twenty-seven wooden beams carry the main buildings, and iron chains and beams add reinforcement.

Wooden pillars beneath the galleries of Xuankong Hanging Temple
Wooden pillars and cantilevered halls of the Hanging Temple, seen from below

The halls themselves sit more than 30 metres above the ground, and the whole complex follows the line of the cliff, so each roof, gallery and stair is shaped by the rock behind it.

Halls of the three teachings: Buddhism, Taoism and Confucianism

The temple is mainly Buddhist, but it brings together the “three teachings” of Chinese tradition. Around 40 halls and pavilions are linked by walkways, stairs and narrow bridges, divided into a northern and a southern section.

Xuankong Temple, which brings together Buddhism, Taoism and Confucianism
  • Northern section: the Wufo Hall of the Five Tathagatas, the Guanyin Hall, and the Hall of Three Religions, where Śākyamuni Buddha sits in the centre with Laozi on his left and Confucius on his right.
  • Southern section: three floors with the Chunyang Palace, dedicated to the Taoist immortal Lü Dongbin; the Sanguan Hall, the largest, with Ming-era clay figures of the Three Great Emperor-Officials; and, at the top, the Leiyin (Thunder) Hall dedicated to Śākyamuni.

Seeing the Buddha, Laozi and Confucius side by side in one hall is the temple’s great surprise, and the reason it holds a special place in Chinese religious history.

Xuankong Hanging Temple suspended on the side of Mount Hengshan
The Hanging Temple’s halls and walkways on the Mount Hengshan cliff

Visiting the Hanging Temple from Datong

Most travellers combine the Hanging Temple with Mount Heng in a day trip from Datong, and many add the Yungang Grottoes on a second day. Plan for the drive of roughly 64 km each way.

  • Go early: the walkways and bridges between the halls are narrow, and the site is busiest in summer and on Chinese public holidays.
  • Look from below first: the best overall view of the cantilevered halls is from the gorge floor, before you climb.
  • Check access in advance: confirm current tickets and opening arrangements for the upper galleries before you travel.
The Hanging Temple, one of the main historic sites of the Datong area

For more monasteries built on rock, our Meteora guide visits the Orthodox monasteries on the rock pillars of Thessaly in Greece, and Thiksey in Ladakh climbs a Himalayan hilltop.