LIMA, May 3 (Reuters) - Peru’s Supreme Court ruled on Wednesday in favor of a farmer who Newmont Mining Corp claimed had illegally occupied its land, dealing a blow to the U.S. miner’s long-stalled efforts to build a $5 billion gold mine in the Andean country.

A lower court had ruled in favor of potato farmer Máxima Acuña in 2014, a decision Newmont appealed. While the court’s Wednesday ruling upholding the lower court’s decision in the criminal case is final, two civil cases to determine ownership of the land are still winding through the courts.

Newmont put plans to build its Conga mine on hold after violent protests broke out in Peru’s northern Cajamarca region, one of the country’s poorest and its second-largest in gold production. Environmentalists said the mine would poison local water sources and displace people living and farming there.

Acuña had said her home was destroyed as part of the mine’s construction, and that the family’s attempts to rebuild it have been blocked. Newmont’s Peruvian unit Minera Yanacocha SRL, in which Peru’s Buenaventura SAA is a junior partner, took her to criminal court, saying she had “usurped” its land.

“I feel happy and relieved that here in the capital [the court] has also provided justice,” Acuña, who won the Goldman Prize for environmental activism last year, said after the court hearing on Wednesday. “I only hope not to suffer more abuse from the company.”

Speaking to reporters after the court decision, Yanacocha lawyer Christian Schroder said the company considered the disputed lands part of its property. Yanacocha is open to “dialogue with the family to not continue all these cases underway,” he said.

Yanacocha’s namesake mine, also in Cajamarca, has historically been the country’s largest, but production has fallen in recent years. Conga has been expected to offset dwindling output at the aging Yanacocha, and Buenaventura told Reuters earlier this year it was studying a long-term business plan with Newmont that could include Conga. In a statement, Yanacocha said it would respect the Supreme Court decision and would “continue defending the company’s rights” through the pending civil court cases. (Reporting by Marco Aquino; Writing by Luc Cohen; editing by Diane Craft)