Ancient Chinese graffiti discovered on the walls of a cave in central China tells the story of how droughts effected the people of the area over a 500-year period.

The scrawls were found on the walls of Dayu Cave in the Qinling Mountains of central China and depict seven droughts and the turmoil they brought between 1520 and 1920, the study in Scientific Reports states.

This, together with chemical analysis of stalagmites in the cave, is the first time in which scientists have been able to conduct an on-site comparison of historical and geological records from the same cave. According to the graffiti, it is a place where people came for water and to pray for rain during the droughts.

Dr Sebastian Breitenbach of Cambridge's Department of Earth Sciences, one of the paper's co-authors, said: "In addition to the obvious impact of droughts, they have also been linked to the downfall of cultures – when people don't have enough water, hardship is inevitable and conflict arises. In the past decade, records found in caves and lakes have shown a possible link between climate change and the demise of several Chinese dynasties during the last 1,800 years, such as the Tang, Yuan and Ming Dynasties."

An inscription from 1891 reads: "On May 24th, 17th year of the Emperor Guangxu period, Qing Dynasty, the local mayor, Huaizong Zhu led more than 200 people into the cave to get water. A fortune-teller named Zhenrong Ran prayed for rain during the ceremony."

Another from 1528 states: "Drought occurred in the 7th year of the Emperor Jiajing period, Ming Dynasty. Gui Jiang and Sishan Jiang came to Da'an town to acknowledge the Dragon Lake inside in Dayu Cave."

Dr Liangcheng Tan of the Institute of Earth Environment at the Chinese Academy of Sciences in Xi'an, and the paper's lead author, added: "There are examples of things like human remains, tools and pottery being found in caves, but it's exceptional to find something like these dated inscriptions. Combined with the evidence found in the physical formations in the cave, the inscriptions were a crucial way for us to confirm the link between climate and the geochemical record in the cave, and the effect that drought has on a landscape."

The local climate in the area is heavily reliant upon the summer monsoon, which brings 70% of the annual rainfall within a few months.