Moisture conditions, especially those that occur as multi-decadal anomalies, have profound impacts on society, especially in arid and semi-arid regions. However, the lack of high-resolution climatic data for the rst millennium CE greatly limits our understanding how moisture variations have in uenced history.Here, we present an 1882-year (134-2015 CE) tree-ring chronology developed from the Qilian juniper (Juniperus przewalskii Kom.) growing in the western Qilian Mountains, northwest China. The tree-ring index correlates signi cantly with the May-June self-calibrating Palmer Drought Severity Index (sc-PDSI)and could therefore be used to reconstruct May-June moisture variations since 241 CE. The reconstruction re ects moisture conditions at the annual to multi-decadal time scales over the past two millennia. During the period from the 3rd to 8th centuries, there were prominent interdecadal uctuations, with the 3rd century and the late 5th century being the wettest and driest periods in the reconstruction, respectively. The transition from the wet 3rd century to the dry 5th century corresponded with key events in Chinese history, namely the demise of the Western Jin Dynasty and the chaotic Southern and Northern Dynasties, as well as the fall of the ancient Loulan Kingdom in eastern Xinjiang. Thus, our reconstruction provides new evidence for the close linkage between abnormal climate conditions and social changes in ancient times.