By Jyotsna Singh
BBC News, Delhi
India's Supreme Court has said it could stop further construction of the Narmada dam if the authorities do not compensate displaced people.
Ms Patkar fasted for 20 days to protest against the dam's height
The court told the Madhya Pradesh state government thousands of villages should be resettled and given adequate help.
The warning came as campaigners against the dam ended a 20-day hunger strike.
Thousands of people have been displaced by the project. Officials say the dam is essential for drought-prone areas in Gujarat and Madhya Pradesh.
The latest round of protests was sparked off by a decision to raise the height of the dam from 110 to 121 metres.
The Supreme Court said it would have "no choice but to stop the construction if the government fails to complete rehabilitation".
Opponents of the dam say more people face eviction if the height of the dam is allowed to be raised by another 11 metres, as per a recent court order.
Mr Modi fasted for 51 hours in support of the dam
Anti-dam activists, led by environmentalist Medha Patkar, ended a 20-day hunger strike on Monday. They have demanded the government stop work on the dam until it has completed the rehabilitation work in the area.
The chief minister of western Gujarat state, Narendra Modi, began a fast ahead of the court hearing in protest at campaigners' efforts. He ended his fast after 30 hours following the court's ruling.
The Sardar Sarovar dam project is being built on the Narmada river to resolve power and water shortages in central and western India.
The dam project was initiated in the 1950's
The project was initiated by India's first prime minister, Jawaharlal Nehru, in the 1950s. But it ran into long delays, legal disputes and protests.
Gujarat is one of the four states which stand to benefit from the project - which is expected to bring crucial water to its parched Saurashtra and Kutch regions. The three other states are Maharashtra, Rajasthan and Madhya Pradesh.
People in Gujarat want the dam to be completed soon. But it is a tricky issue for the government of Madhya Pradesh where thousands of people have been displaced.
For more than a decade the protests have been led by well-known activist Medha Patkar and India's Booker prize winning author Arundhati Roy.
The case is due to be heard again in the Supreme Court on 1 May.