The Government's controversial plans for secret court hearings are on the verge of becoming law after peers rejected further safeguards to the legislation.
Despite support from Labour and some Tory and Liberal Democrat peers, the House of Lords voted against a move to place extra restrictions on the use of closed material procedures (CMPs).
Under CMPs, evidence that usually would not be brought forward for fear of endangering national security could be heard in secret in civil cases without the claimant being able to see it.
Minister Without Portfolio Ken Clarke argues the change in the law is needed to prevent the UK becoming a "global magnet" for people seeking taxpayer-funded settlements because they know sensitive security-based evidence can not be used against them in court.
Peers voted by 174 to 158, Government majority 16, against a Labour amendment to the Justice and Security Bill to allow CMPs only if a judge ruled a fair verdict was not possible "by any other means".
A plan put forward by former director of public prosecutions Lord Macdonald of River Glaven that would have forced a judge to balance the interests of "national security" and "fair and open administration of justice" was withdrawn without a vote.
Lord Macdonald, a Lib Dem peer, said: "It is matter of regret to me that my own party in the face of the striking illiberality at the heart of this legislation associated itself with the removal in the Commons of safeguards previously added to the Bill in this House.
"I believe this was a grave mistake and this Bill as a result presents renewed risks."
But for the Government advocate general Lord Wallace of Tankerness told peers there were sufficient safeguards in place.
"It is second-best justice but at least it is justice," he said.
Lord Wallace told peers that "significant changes" had been made to the legislation in the Commons to "reflect the intention" of the three defeats the Government suffered when the Bill was first debated in the Lords last year.
He said under the amendments accepted by MPs and now agreed by peers, the judge would have "total discretion" on whether to grant a CMP.
"The decision rests with the judge not the secretary of state," he said.
And he told peers: "What we have sought to do is to ensure that this should be a procedure used only in very exceptional circumstances."
He said CMPs were "proportionate" and could only be used when information may "damage the interests of national security" if disclosed.
Lord Wallace was backed by former head of MI5 and independent crossbench peer Baroness Manningham-Buller.
She said CMPs were "primarily about making sure that some of these extraordinarily serious allegations are actually heard".
And she raised fears about the effect that Lord Macdonald's plan could have on the security services.
"The suggestion that these two things (national security and open justice) could be held in balance potentially has a very chilling effect on the willingness of people give up information," she said.
But Labour's Baroness Kennedy of The Shaws, a leading human rights QC, said: "Where is the end to this and do we start seeing a process of creep that is likely to happen if we don't say very clearly that this has be the last resort?"
And former justice of the Supreme Court Lord Brown of Eaton-under-Heywood urged peers to accept the safeguards to "demonstrate to the world that this House is truly alive to the guiding principle of open justice".