Caves have long provided shelter for people around the globe. In south Spain, the rocky formations first served as a sanctuary from wild storms and predatory animals. Later, they offered protection from religious and racial persecution. Now, the structures are home to unique and quietly proud communities who have eschewed modern life for the peaceful solitude of the mountains.

For Chilean photographer Tamara Merino, who has been photographing cave-dwellers around the world, it’s the history and the raw relationship between the landscape and its inhabitants that interested her most. “I've always been fascinated by the way humans relate to the land and environment and how it impacts their lives,” says Merino.

In the second part of her ongoing project—the first of which took her to the Australian opal town of Coober Pedy—Merino spent a fortnight in Spain’s Andalucía region to document the stories of those living in its cave-studded countryside. “The most important thing was not to have any preconceptions,” she says. “I like to sit with people and hear their stories. I share my life with them as well.”

View Images The sky darkens over the doorway of a cave home in Benalúa, a village in the mountains of southern Spain. Photograph by Tamara Merino

In the province of Guadix, home to roughly 2,000 underground houses, she found residents continuing agricultural life as it existed 500 years ago. “They still live with the animals inside the caves,” says Merino.

Further along the valley, the Sacromonte, or Sacred Mount, caves are nestled above the sprawling city of Granada, where a melting pot of cultures and ethnicities coexist. The more isolated territory in the mountain’s upper region is mainly occupied by illegal squatters, many of whom are also undocumented immigrants. Meanwhile, the lower portion is mostly home to legal residents drawn to cave life for environmental and cultural reasons, says Merino.

View Images Judith, a 12-year-old girl who lives in Guadix, walks over the top of a cave dwelling. The region has been home to underground residents for hundreds of years. Photograph by Tamara Merino

Sacromonte is the birthplace of Spanish flamenco, a dance created by Spain’s gitano, or Romani, community. Many members of the community, like Henrique Amaya, continue to live in the caves as a way to honor their culture.

"I was born inside a cave with the animals and the beasts,” says Amaya, whose family has lived in the Sacromonte caves for six generations. His ancestors were the originators of the Zambra flamenco, first performed in those caves more than 500 years ago.

Amaya started dancing when he was just three years old. For him, performing flamenco and reciting gitano poetry on the site of so much personal history creates a powerful connection to his forefathers. “It feels pure and fresh,” he says. “It is like going to a waterfall at 4 a.m. and putting my head inside the water.”

View Images Mbacke stands over the city of Granada from the space in front of his cave. Photograph by Tamara Merino

Tocuato Lopez is also a lifelong cave resident; his family has been in the Guadix caves for four generations. The caves offer shelter from the unbearable summer heat but, more importantly, they provide a sense of deep-rooted community. Despite growing up in poverty—he and his sister used to walk for more than 2.5 miles to the neighboring town to beg for food—he has a strong affection for his home.

"I'm very proud of being from the cave and still living in the cave,” says the father of four. “I will die in the cave."

View Images The front door of a cave protrudes slightly from a rocky wall in Sacromonte. Many of these caves exist in an unclear legal vacuum, allowing for easy and sometimes illegal occupation. Photograph by Tamara Merino