A court in India has said it could block sites like Facebook and Google if they failed to crack down on offensive internet content.
The Delhi High Court said "like China, we will block all such websites".
India has more than 100 million internet users and web companies say the large number means broad action is impossible.
Earlier, a government minister had accused the internet firms of not co-operating in removing such content.
Last month, Communications Minister Kapil Sibal met officials from Google, Facebook and other websites and said the government would introduce guidelines to ensure "blasphemous material" did not appear on internet.
Doctored photos of PM Manmohan Singh and ruling Congress party leader Sonia Gandhi have angered the government.
On Thursday, Justice Suresh Kait of the Delhi High Court asked Facebook and Google India to "develop a mechanism to keep a check and remove offensive and objectionable material from their web pages", according to the Press Trust of India news agency.
Mukul Rohatgi, a lawyer for Google India, said "obscene, objectionable and defamatory" content could not be filtered or monitored.
"No human interference is possible and, moreover, it can't be feasible to check such incidents. Billions of people across the globe post their articles on the website. Yes, they may be defamatory, obscene but cannot be checked," Mr Rohatgi was quoted as telling the court.
"We cannot control billion minds. Some are conservative, some are liberal and some write all the defamatory and obnoxious articles on web pages. There is a procedure for getting them removed."
Facebook - which has 28 million users in India - had said in a statement last month that it recognised the "government's interest in minimising the amount of abusive content available online".
But, it said, there were policies in place that enabled people to report abusive content.
The High Court was hearing petitions filed by Facebook India and Google India challenging summons by a trial court for allegedly carrying offensive material on their sites.
Last month, a lower court, acting on a complaint by a journalist about offensive material on the internet, summoned 21 websites to explain what measures they were taking to remove it.
In October 2010, a leading school in India suspended 16 students for posting rude remarks about a woman teacher on Facebook.