The government has suffered a series of heavy defeats in the House of Lords over its plans to allow more civil courts to examine secret intelligence in private.
Under the Justice and Security Bill, sensitive intelligence information could be heard by a judge in secret - known as closed material proceedings (CMPs) - to protect national security.
It means some defendants would not hear all the evidence against them, which critics say would threaten the principle of open justice.
Peers voted by a majority of 100 on 21 November 2012 to give judges and defendants - not just ministers - the right to demand that CMPs are used.
A call to give courts a discretion, rather than an duty, to order civil court cases to be heard behind closed doors was approved by 264 votes to 159, a majority of 105.
Peers also backed moves to require judges to balance the harm caused by the disclosure of information with "the fair and open administration of justice", by an 87-vote majority.
Further amendments were approved without a vote after the government indicated it would not oppose them "at this stage".
The changes included ensuring closed material proceedings would only be used as a last resort.
Crossbencher Lord Pannick, whose amendments peers were voting on, argued that CMPs should only be used as a "last resort" because they were a "radical departure" from common law principles.
His argument was supported by peers including Liberal Democrat Lord Lester of Herne Hill and the Conservatives' Lord Hodgson of Astley Abbotts.
Liberal Democrat Lord Phillips of Sudbury said the bill, in its present form, failed to balance the "two competing issues" of liberty and national security.
Conservative peer Baroness Berridge said it should be up to a judge, not the government, to decide on the fairest way to proceed with a case.
She urged the Lords to "stand firm" on the principle.
However, former Conservative security minister Baroness Neville-Jones countered that the bill was a "balanced response" to a "difficult" issue, and feared some amendments went "too far".
She said a judge was unlikely to authorise a CMP "if he did not think there was a substantial national security interest to be protected".
Labour supported all of the amendments, arguing that "secret courts" went against "the right of a party to know and to challenge his opponent's case".
For the government, Advocate General Lord Wallace of Tankerness said there were currently 20 civil damages cases where material "relating to national security would be central".
"If there is a valid claim being put forward by a claimant, the claimant may not actually be able to have that claim properly vindicated but the case has to settle, but material was necessarily excluded from the court," he said.