New Delhi, India: In this picture taken 02 May 2005, stray cows cross a traffic intersection in New Delhi. Getty

New Dehli -- Authorities in India's most populous state have been ordered to bar code stray cows and use vacant buildings to shelter them in response to farmers' complaints that the closure of slaughterhouses has created a menace of crop-destroying, free-range cattle.

An order by the Hindu nationalist-led Uttar Pradesh state government this week also says that officials should use radio frequency identification technology to scan the tags to help keep track of stray cows.

Since the government began closing cow slaughterhouses in 2017, many farmers have abandoned their cattle, unable to continue feeding them after they stop producing milk.

Get Breaking News Delivered to Your Inbox

Slaughtering cows is banned in parts of predominantly Hindu India, including Uttar Pradesh state. Cows are considered holy by Hindus.

Earlier this month, fed-up farmers in the city of Agra herded a group of stray cows into a government school building, forcing school children to attend class outdoors.

Surendera Narain Pandey, a farmer, said that he used to sell an old cow for up to 10,000 rupees ($140), using the proceeds to buy a milk-yielding one that costs five times more.

"The situation has changed. We cannot afford to feed an unproductive cow now," he said.

Cows are a source of tension in India. The Hindu majority, who make up 80 percent of India's population of 1.3 billion, consider cows to be sacred. For them eating beef is taboo.

There have been various incidents of cow related violence, as Hindus and members of the country's Muslim minority have clashed.

There has been a rise in cow-related lynchings and beatings since the ruling Hindu nationalist Bharatiya Janata Party was voted into power in a landslide victory in 2014. Most of the attacks have been attributed to local Hindu radical groups.

Indian performers walk with their decorated bulls known as a 'Gangireddu' on a street in Hyderabad on January 12, 2019. Getty

Since May 2015, "a violent vigilante campaign against beef consumption" has led to the killings of at least 10 Muslims, including a 12-year-old boy, in seven mob violence cases, according to Human Rights Watch.

Over the last two years vigilante groups who call themselves cow protectors have become active in small towns and cities across India. Even lower caste Hindus, who usually carry out undesirable tasks such as skinning dead cattle, have faced mob violence.