RIO DE JANEIRO (Thomson Reuters Foundation) - Brazil’s highest court has averted a “massacre” by blocking the eviction of 5,000 indigenous people from disputed land, one of their leaders said, in a ruling that boosted ancestral claims.

Guarani-Kaiowa Indians occupied the land in the southwestern Mato Grosso do Sul state in 2016, amid rising violence and tensions following Indian affairs agency FUNAI’s pledge to return ancestral land - owned by farmers - to indigenous people.

“We were expecting a new Caarapo massacre,” indigenous leader Kunumi Apyka’i Rory said, referring to a 2016 attack on indigenous activists by farmers in the same region.

“It would be a bloodshed but because of Nhanderu [God] and our prayers we managed,” he said in a statement by Conselho Indigenista Missionario (Cimi), a monitoring group linked to the Catholic Church.

South America’s largest country is grappling with scores of deadly unresolved indigenous land issues, in one of the world’s clearest examples of the conflict between preserving indigenous culture and promoting economic development.

Cimi says hundreds of indigenous people are killed each year in territorial conflicts with ranchers in Brazil, rich in land to be exploited and low on deeds and property records.

Brazil’s highest court on Monday overturned a removal order issued in 2016 by a lower court, following a request from FUNAI, the government agency responsible for restoring indigenous people to land that they were evicted from decades ago.

The use of police force to comply with the earlier legal order could have “serious and unacceptable consequences” and “risk to order and public safety”, Carmen Lucia, head of the supreme court, wrote in her decision.

“This scenario seems to show a risk of exacerbation between the parties in conflict and a consequent worsening situation of violence in the region,” she said.

Brazil’s 900,000 indigenous people - who are disproportionately impacted by poverty and other social problems - control about 13 percent of its territory, mostly in the remote Amazon rainforest.

Numerous court battles pit native people, who say they have been denied access to their ancestral land, against powerful business interests, often soy, beef and sugar farmers holding title deeds.

The process of demarcating land to indigenous people is controversial, despite safeguards in the constitution and United Nations guidelines that are supposed to enshrine rights for indigenous people.

FUNAI is in charge of allocating land to the country’s some 300 indigenous tribes but progress has stalled amid budget cuts and proposals from powerful rural lawmakers to change the process, including opening up indigenous reserves to mining.

The Supreme Court decision paves the way for secure land demarcation for indigenous peoples throughout the country, said Rafael Modesto dos Santos, a lawyer with Cimi.

“It guarantees the indigenous people’s lives and physical integrity,” he told the Thomson Reuters Foundation by phone.

“(Otherwise) there would be a massacre, that is no doubt ... because 5,000 indigenous people with no possibility of defense (would) confront the government apparatus of war.”

Dos Santos said most land conflicts in Mato Grosso do Sul state derive from the illegal sale of indigenous land by the local government to ranchers, and the subsequent issuance of illegal titles over the last century.

A spokeswoman for the government of Mato Grosso do Sul, Beatricce Bruno, denied the accusations in emailed comments and said that it has always respected the law and court decisions.

Conflict over indigenous land in the state “is an old problem ... due to the lack of a secure legal framework”, she said.

The supreme court’s emergency decision to prevent the evictions will allow the Guarani-Kaiowa to remain on the land until the court issues a final decision on its ownership, which could take up to 10 years, dos Santos said.