Abtai Sain Khan, ruler of the Khalkha Mongols and grandfather of Zanabazar, the first Jebtsundamba Khutuktu, ordered construction of the Erdene Zuu monastery in 1585 after his meeting with the 3rd Dalai Lama and the declaration of Tibetan Buddhism as the state religion of Mongolia. Stones from the nearby ruins of the ancient Mongol capital of Karakorum were used in its construction. Planners attempted to create a surrounding wall that resembled a Tibetan Buddhist rosary featuring 108 stupas (108 being a sacred number in Buddhism), but this objective was probably never achieved. The monastery's temple walls were painted, and the Chinese-style roof covered with green tiles.