BOCA COLORADO, Peru — Below an umbrella of trees deep in the Peruvian Amazon, drunken miners carry on their shoulders the casket of a man whose search for gold ended with a bullet in his stomach.

“In my heart there is no peace,” Father Pedro Zabala sings as the coffin is lowered into the dirt in a cemetery where the graves of about 50 other illegal miners are marked with plain black crosses.

The 70-year-old Spanish priest tends to some of the rainforest’s most hapless souls. Men from poor villages who search mercury-laced rivers for a pebble of gold. Women who sell their bodies in the brothels near illegal mining camps. And people like Juan Peralta, who was shot dead in a dispute with an indigenous tribe and had no wife, children or relatives to mourn him.

It’s near this forlorn corner of the Amazon that Pope Francis will visit Friday amid what has been called a modern-day gold rush of illegal miners threatening the world’s largest rainforest. Mercury used by the miners to unearth small specks of gold has contaminated streams and rivers. New roads have been hacked into the rainforest and loggers have slashed away swaths of the delicate ecosystem.

Zabala, whose long white beard and bare feet are a regular sight in the bars frequented by miners and sex workers, says his flock is unlikely to welcome Francis’s message, which is expected to encourage Peruvians to protect the Amazon. In a letter to bishops, Francis likened the rainforest to one of the “lungs of our planet” that must be preserved.

“It’s easy to talk from Lima or Rome,” said Zabala, a biology graduate who later turned to the Church. “But what will these people eat if they’re kicked out?”

Most of the miners in Boca Colorado are young men with few prospects lured by the promise of earning hundreds of dollars for a single nugget of gold.

More than half of Peru lies within the Amazon biome, which spans nine countries and is home to one-tenth of the world’s species. In recent decades, the Amazon has undergone a dramatic transformation, with dams, expanded ranching and mining decimating nearly one-fifth of the total forest.

In the Madre de Dios region Francis will visit, 97,000 forest hectares have been decimated, the equivalent of nearly 136,000 soccer fields, according to the most recent satellite images from the Center for Amazonian Scientific Innovation. Small-scale miners like the ones Zabala comforts are a major driver of the colonization that fuels the forest degradation and pollutes the rivers.

“The black and white photos from the California Gold Rush look very similar to the mines of the Amazon,” said Luis Fernandez, a tropical ecologist.

Zabala first traveled to the Amazon in 1978 as a young biologist collecting butterflies and condors for his university’s museum in Spain. He returned to Peru years later to work in the Amazon, this time as a priest. He was warned by fellow clergy that the region was “like Sodom and Gomorrah,” a biblical reference to two cities destroyed in a firestorm after offending God.

“God is in all parts,” he remembers telling his colleagues.

He has lived in the Amazon for 24 years now and spent the last 10 running a Catholic parish that works with about two dozen mining camps. The man known as Padre Pablo cuts an eccentric figure dressed in light pajamas that he says are ideal for the humid climate and hanging out in rough cantinas decorated with posters of women in tiny bikinis.

Zabala says he had long felt compelled to work not just with the righteous, but with the sinners, and, taking a cue from the pontiff, connect with “the life of the common people.”

He credits the women who work in the bars with helping build two churches and has encouraged them to pray to Mary Magdalene. Each year he takes a sculpture of the woman considered Jesus’ most important female disciple into a local bar as part of a religious procession.

“Whatever happens to me, I go and consult with the father,” said Lisethe Pilares, 25, who says she used to work in the bars. “I am very devoted.”

Sometimes the miners call Zabala late into the night, haunted by images of friends buried alive under piles of collapsed sand or killed in river canoe accidents.

“He’s there for the difficult moments,” said Juana Roque, 34, who lives in a mining camp with her husband and two children.

In spite of Zabala’s work, Francis is not a popular figure among the miners who associate him with their enemies: ecologists. In a 2015 encyclical, Francis recognized the Amazon and other tropical forests as rich havens of biodiversity that can turn into arid wastelands and urged that a “delicate balance” be maintained.

Zabala said that for the 85,000 families who survive by mining gold in the Amazon another problem must be addressed first: poverty. Many of the men and women who dig for precious metals have few other means to earn a living and feel they have a more legitimate right to the Amazon’s riches than the multinational corporations also digging in.

“They feel the encyclical was not created for here, but for another world,” he says.

It was late on a recent night when Zabala received a call from a woman who told him that a gold miner named Juan Peralta had died. His story was like that of many of the men here: He was from a small city on the outskirts of the Amazon and arrived alone, settling in a savage land where riches tend to come at a dangerously high price.

According to friends, Peralta was shot by an armed indigenous tribe upset that he was trying to mine in a territory they consider theirs.

Two weeks after his death, no relatives had arrived to mourn or claim his body. Instead it was Zabala who accompanied the remains to the rainforest cemetery, uttering a prayer as the body was lowered into the chocolate-colored earth.

Associated Press writer Christine Armario in Lima, Peru, contributed to this report.