An unprecedented attempt by a British oil trading firm to prevent the Guardian reporting parliamentary proceedings has collapsed following a spontaneous online campaign to spread the information the paper had been barred from publishing.

Carter-Ruck, the law firm representing Trafigura, was accused of infringing the supremacy of parliament after it insisted that an injunction obtained against the Guardian prevented the paper from reporting a question tabled on Monday by the Labour MP Paul Farrelly.

Farrelly's question was about the implications for press freedom of an order obtained by Trafigura preventing the Guardian and other media from publishing the contents of a report related to the dumping of toxic waste in Ivory Coast.

In today's edition, the Guardian was prevented from identifying Farrelly, reporting the nature of his question, where the question could be found, which company had sought the gag, or even which order was constraining its coverage.

But overnight numerous users of the social networking site Twitter posted details of Farrelly's question and by this morning the full text had been published on two prominent blogs as well as in the magazine Private Eye.

Carter-Ruck withdrew its gagging attempt by lunchtime, shortly before a 2pm high court hearing at which the Guardian was about to challenge its stance, with the backing of other national newspapers.

MPs from all three major parties condemned the firm's attempt to prevent the reporting of parliamentary proceedings. Farrelly told John Bercow, the Speaker: "Yesterday, I understand, Carter-Ruck quite astonishingly warned of legal action if the Guardian reported my question. In view of the seriousness of this, will you accept representations from me over this matter and consider whether Carter-Ruck's behaviour constitutes a potential contempt of parliament?"

The Commons question reveals that Trafigura has obtained a hitherto secret injunction, known as a "super-injunction", to prevent disclosures about toxic oil waste it arranged to be dumped in west Africa in 2006, making thousands of people ill.

Farrelly is asking Jack Straw, the justice secretary, about the implications for press freedom of a high court injunction obtained on 11 September 2009 by Trafigura "on the publication of the Minton report on the alleged dumping of toxic waste in the Ivory Coast, commissioned by Trafigura".

The Guardian is still forbidden by the terms of the existing injunction, granted by a vacation duty judge, Mr Justice Maddison, to give further information about the Minton report, or its contents. Last month, Trafigura agreed to pay more than £30m in compensation and legal costs to 30,000 inhabitants of Abidjan in Ivory Coast, for "flu-like symptoms" they might have suffered following the dumping. The oil traders continue to deny that the waste could have caused serious or fatal injuries.

The use of "super-injunctions", under which commercial corporations claim the right to keep secret the fact that they have been to court, has been growing. Anonymity is also increasingly being granted to individual litigants.

Last week, an anonymity order was overturned at the supreme court under which Mohammed al-Ghabra, an alleged al-Qaida financier named in official UN and Treasury publications, was to be known only as G. A further pending supreme court case involving an MI5 officer's memoirs is currently only known as "A v B".

Alan Rusbridger, the editor of the Guardian, said yesterday: "I'm very pleased that common sense has prevailed and that Carter-Ruck are now prepared to vary their draconian injunction to allow reporting of parliament. It is time that judges stopped granting super-injunctions which are so absolute and wide-ranging that nothing about them can be reported at all."

Carter-Ruck, whose partner Adam Tudor has been representing Trafigura, issued a press release conceding: "The order would indeed have prevented the Guardian from reporting on the parliamentary question which had been tabled for later this week." But the firm said the Guardian's reporting on the issue had been "highly misleading".

The firm added: "There is no question of Trafigura seeking to gag the media from reporting parliamentary proceedings, and the parties have now agreed to an amendment to the existing order so as to reflect that."

The previous night, Carter-Ruck had written to the Guardian saying: "The threatened publication would place the Guardian in contempt of court … please confirm by immediate return that the publications threatened will not take place."

At Westminster, the Liberal Democrat MP Evan Harris said there was a need to "control the habit of law firms" of obtaining secrecy injunctions, and his colleague David Heath told the Commons a "fundamental principle" was being threatened: that MPs should be able to speak freely and have their words reported freely.

On the Conservative side, David Davis, the former shadow home secretary, criticised the rising use of super-injunctions, in which the fact of the injunction is itself kept secret.

He said courts should not be allowed to grant injunctions forbidding the reporting of parliament.

Bercow said the issue could be raised formally as a matter of privilege, but he understood the injunction had been lifted.

Farrelly told the Guardian afterwards: "The issuing by the courts of so-called super-injunctions is rightly controversial and a matter of growing concern. That is why, using parliamentary privilege, I tabled these questions.

"The practice offends the time-honoured rule against prior restraint, which safeguards freedom of expression in this country.

"It also fails to protect whistleblowers acting in the public interest. The huge legal bills involved in fighting cases, too, have a chilling effect on legitimate investigative journalism.

"So often, the beneficiaries are big corporations. The fact that the press is also barred from reporting the existence of these gagging orders is doubly pernicious."