India's Supreme Court has given the government a week to review its suspension of internet services in Indian-administered Kashmir.
The region has not had access to the internet for more than 150 days, India's longest such shutdown.
The government suspended internet, mobile phone and landline services in Kashmir before stripping it of partial autonomy on 5 August.
The court was responding to a clutch of petitions challenging the restrictions.
"Complete curb of internet must be considered by the state only as an extraordinary measure," said Justice NV Ramana, reading out the judgement on Friday, adding that access to the internet was part of the right to freedom of speech and expression guaranteed by the constitution.
The three-judge bench also ruled that the indefinite suspension of internet services is "impermissible" and such restrictions can "be temporary only".
Some mobile phone and landline services were restored in October, but the indefinite internet suspension has crippled daily life, the media and businesses.
The move by the ruling Bharatiya Janata Party (BJP) government to revoke the region's autonomy was controversial as it underpinned Kashmir's fraught relationship with Delhi. India has also been fighting a long-running insurgency in the Muslim-majority valley.
The second-longest internet shutdown in India was also in Kashmir - it lasted from 8 July to 19 November in 2016. But the blackout this time -which also initially included phone services - has severely hurt the region's economy. A range of businesses, from IT services to trade are struggling to operate.
A colonial-era law, known as section 144, which prohibits a gathering of more than four people to prevent violence or any disruption of law and order, has also been imposed in the region.
But the court ruled that the law cannot be used "as a curb on legitimate expression of democratic rights." It ordered the government to review all orders imposing such restrictions within seven days.
While the government has maintained that the region has been largely calm, it has also said the restrictions have been in place to prevent violence.
In October, parliament also formally divided the state of Jammu and Kashmir into two new federally-administered territories, which are now ruled directly from the capital Delhi. Union territories have far less autonomy from the federal government than states do.
It's widely believed that this was done to tighten the Indian government's control over the part of Kashmir it administers.
India's longest shutdowns:
- 159 days and counting: Internet services were suspended on 4 August in Jammu and Kashmir this year
- 133 days: An internet shutdown in Indian-administered Kashmir which lasted from 8 July to 19 November in 2016
- 99 days: Authorities shut off the internet in India's West Bengal state from 18 June to 25 September in 2017