India's Supreme Court has suspended a law that would have banned the sale of cattle for slaughter nationwide.
The government order aimed to "prevent uncontrolled and unregulated animal trade" at livestock markets.
For the first time the sale for slaughter of buffaloes and camels as well as cows, which Hindus consider holy, would have been illegal.
It would have had a major impact on the meat and leather industries and hit livelihoods, the chief justice said.
These industries are dominated by minority Muslims and the proposed law was widely opposed.
The new law had already been stayed by a lower court in the southern state of Tamil Nadu on 30 May, days after it was first announced.
The top court said the Madras high court's interim order, which lapsed on 8 July, would continue and remained in force across the country.
The government is now expected to make changes and resubmit amendments to the law by the end of August.
Cows are considered holy by India's majority Hindu population and slaughtering them is already banned in most but not all states, but this would have been the first time buffaloes had been included in a slaughter ban.
Most of India's beef comes from water buffaloes rather than cows. With annual exports worth $4bn (£3.1bn), India is the largest exporter of beef, mostly buffalo meat, in the world.
Chief Justice Jagdish Singh Khehar said in his order that "the livelihood of people should not be affected by this".
Petitioners in Tamil Nadu had argued that the ban infringed their right to choose what they ate.
Abdul Faheem Qureshi, the head of the Muslim All India Jamiatul Quresh Action Committee that supports meat sellers, who had lodged the petition with the Supreme Court, told Reuters news agency that the order was a "victory".
Many states have actively started enforcing bans on cow slaughter after the Hindu nationalist Bharatiya Janata Party formed India's federal government in 2014.
The western state of Gujarat passed a law in March making the slaughter of cows punishable with life imprisonment. In addition to government bans, vigilante groups who portray themselves as protectors of cows have been active in several states.
In some cases, these groups have killed Muslim men they suspect of killing cows. Prime Minister Narendra Modi, who said last year that cow vigilante groups made him "angry", said again in June that killing in the name of cow protection was "not acceptable".
However, this has not stopped attacks against cattle traders.
Mr Modi's critics say the new law is aimed at appeasing India's Hindu community.