New Delhi CNN Business  — 

PepsiCo has backed down from a controversial fight with Indian farmers it accused of illegally growing its registered potatoes.

The company is withdrawing a lawsuit it filed last month against four small Indian farmers for growing a potato variety it had registered for exclusive use in Lays potato chips.

“After discussions with the [Indian] government, the company has agreed to withdraw cases against farmers,” a PepsiCo India spokesperson said in a statement. “We are relying on the said discussions to find a long term and an amicable resolution of all issues around seed protection.”

PepsiCo had offered to settle with the farmers, but found itself under increasing pressure from agricultural unions and activists to drop the suit.

The lawsuit thrust the giant American food and beverage company into a debate about the rights of India’s hundreds of millions of farmers — a political base vital to Prime Minister Narendra Modi’s hopes of winning a second term in national elections over the next three weeks.

Declining rural incomes have prompted mass protests by farmers, and some have been driven to suicide in desperation at their poverty. As part of his election campaign, Modi has promised to double their incomes by 2022 and provide pensions to small farmers over the age of 60.

Activists are now urging the government to do more to enable farmers to grow the crops they want.

“The government should put into place clear mechanisms to avoid a repetition of this episode in future,” the Alliance for Sustainable and Holistic Agriculture (ASHA) said in a statement.

Laborers at work on a potato farm. Rural incomes have been declining in India.

PepsiCo said that it had spent decades working with thousands of Indian farmers and was “compelled to take judicial recourse” against farmers not affiliated with its potato farming program to protect its registered variety.

“The company remains deeply committed to the thousands of farmers we work with across the country and towards ensuring adoption of best farming practices,” its spokesperson added.

The farmers’ advocacy groups are demanding that the global brand do more to repair relations.

“PepsiCo should have apologized for the intimidation and harassment of farmers in this case, and it should have been penalized for adopting these tactics against farmers,” ASHA said.

“PepsiCo should also pay compensation to the sued farmers,” it added.