The government has suffered a defeat in the House of Lords over its plans to change immigration law.
The Nationality and Borders Bill would allow the UK authorities to strip someone of their British citizenship without warning.
But crossbench peer Baroness D'Souza, who argued this would be "unjust", submitted an amendment which was passed by a majority of 44 votes.
The bill will now go back to the House of Commons, which backs the government.
Until the two Houses can agree on the final wording of the bill, it cannot pass into law.
With the parliamentary session expected to end within the next few weeks, ministers must decide whether they need to offer more compromises in order to get the bill into law before time runs out - or hope that peers give up.
The government has been able to revoke people's UK citizenship for more than a century, if they pose a threat to national security or where this is deemed to be in "the public interest", and the home secretary decides each case.
In 2019, for instance, the citizenship of British-born Shamima Begum, who had travelled to Syria to join the Islamic State group in 2015, was revoked on security grounds.
The government's bill goes further, stating that it should no longer have to inform people before their citizenship is removed, but minority groups say they could become "second-class citizens" if this becomes law.
Under the 1948 Universal Declaration of Human Rights, everyone has the right to a nationality, so people cannot "arbitrarily" be left stateless.
But the British government says it is possible to strip people of their citizenship if they have another nationality to fall back on - for example if they have dual citizenship, or if it is possible to get citizenship somewhere else, such as the country their parents come from.
During the Lords debate, Baroness D'Souza, the former Lord Speaker, said it was a "legal fiction" to say that deprivation orders issued recently without notice "continue to be valid", as courts had ruled "to the contrary".
She added that she was not arguing against the orders being issued, but there needed to be "proper safeguards for those who continue to be at risk from previous unlawful actions".
But Home Secretary
Priti Patel has said the change is needed to protect the UK from security risks, promising the new power would be used only in "exceptional circumstances".
Peers approved Lady D'Souza's amendment to the bill by 209 votes to 165.
Last week the government won a string of votes in the Commons when it overturned a series of previous defeats it had suffered in the Lords on the bill.
MPs will debate the bill again when they return from their Easter break later this month.