The Lib Dem party leadership has been defeated over government plans for secret hearings in courts.
Activists at the party conference voted overwhelmingly to scrap legislation enabling judges to hear some civil cases in secret without claimants being able to hear the evidence against them.
Lib Dem peer Lord Strasburger said the proposed legislation was "hopelessly flawed and beyond repair".
However, the vote is not binding on the government - which backs the plans.
Opponents said the vote would carry moral force and empower Lib Dem ministers to seek further changes to the controversial Justice and Security Bill.
Activists cheered as the vote - calling for aspects of the bill relating to secret court hearings to be withdrawn - went their way and defeated an amendment calling for secret hearings to be used as a "last resort".
The Bill would permit closed hearings in certain civil cases in the High Court, the Court of Session or the Court of Appeal and extend provisions for behind-doors hearings in other cases featuring "sensitive information".
The legislation's supporters claim the legislation is needed so the state is able to contest civil claims in terrorism cases in the courts, without undermining national security.
Responding to the defeat, Advocate General for Scotland Lord Wallace acknowledged "significant unease" about the plans but suggested the Lib Dems had already secured major changes, such as removing plans to hold some inquests in private.
"It has always been the government's intention that closed courts should only ever be used as a last resort and in a very small minority of cases where the alternative is no justice at all," he said.
"We will continue to work with parliamentarians from all sides to ensure that the principles of open justice are protected."