Photo/Illutration An Indian farmer is silhouetted as he dismantles a temporary structure used during protests in Ghazipur on the outskirts of New Delhi on Dec. 10. (AP Photo)

NEW DELHI--Tens of thousands of jubilant Indian farmers on Saturday cleared protest sites on the capital’s outskirts and began returning home, marking an end to their year-long demonstrations against agricultural reforms that were repealed by Prime Minister Narendra Modi's government in a rare retreat.

Farmers dismantled their makeshift accommodations at multiple protest sites and started to vacate long stretches of highways ringing New Delhi where they have camped since November last year. Hundreds of them waved green and white flags and danced to celebrate their victory as they rode tractors, jeeps and cars.

“Farmers have saved the democracy. It was a fight for justice,” said farmer Nagendra Singh.

After a year of insisting that the new measures would benefit farmers, Modi made a surprise announcement to withdraw them last month. A bill to repeal the laws was officially passed in Parliament on Nov. 30. But the farmers did not immediately vacate the protest sites and said they would continue to demonstrate until the government agreed to other demands, including guaranteed prices for key crops and the withdrawal of criminal cases against protesters.

On Thursday, the government set up a committee to consider those demands.

Modi’s government had insisted that the laws were necessary reforms to modernize Indian farming and would lead to a deregulated market with more private-sector control of agriculture.

The farmers said the laws would drastically shrink their incomes and leave them at the mercy of big corporations. In protest, they pressed for the complete repeal of the laws.

They also demanded the government guarantee prices for certain essential crops such as wheat and rice. Currently, an overwhelming majority of farmers sell only to government-sanctioned marketplaces at fixed prices.

Farmers form one of India’s most influential voting blocs and Modi’s decision to scrap the laws came ahead of elections early next year in key states like Uttar Pradesh and Punjab, both significant agricultural producers and where his Bharatiya Janata Party is eager to shore up its support.

Political analysts say the upcoming elections are a major reason behind the surprise move, but that it’s too early to say whether it will work.

“Modi apologized to farmers but only after resorting to dictatorship. We were called terrorists. He bowed to protests because of the upcoming elections,” said Jaigran, another farmer who uses just one name.

Initially, Modi’s government had tried to discredit the protestors — mostly Sikh farmers — by dismissing their concerns as motivated by religious nationalism. Some leaders in Modi’s party called them “Khalistanis,” a reference to a movement for an independent Sikh homeland in India.

Such allegations backfired, further angering the farmers and their supporters.

The protests drew international support and were the biggest challenge Modi’s government faced since coming to power in 2014.

They were largely peaceful but violence erupted on Jan. 26 when thousands of farmers briefly took over New Delhi’s historic Red Fort in a deeply symbolic move. At least one farmer died and a number of protesters and police were injured.

Farmers’ leaders say more than 500 protesters have died due to suicide, cold weather and COVID-19 since November last year and they insist the government should pay 500,000 rupees ($6,750) in compensation per family. But the government says it has no figures on the number of deaths during the movement.

The leaders said they will review next month the steps taken by the government and decide their future course of action.