Britain's upper house of parliament has delivered a setback to the Prime Minister Theresa May's Brexit plan.
The House of Lords has voted to make an amendment to the legislation that will give Mrs May the power to trigger the legal process of leaving the European Union.
The amendment requires the government to introduce proposals within three months of the triggering of Article 50 to ensure EU citizens in the UK have the same residence rights after Brexit.
The vote, by 358 to 256, is the first parliamentary defeat for the government's Brexit bill.
However, MPs will be able to remove the changes when the bill returns to the House of Commons and Mrs May is still expected to be able to fulfil her plan to begin the exit process by the end of the month.
The Department for Exiting the EU said: "We are disappointed the Lords have chosen to amend a bill that the Commons passed without amendment.
"The bill has a straightforward purpose - to enact the referendum result and allow the government to get on with the negotiations."
The government said its position had "repeatedly been made clear", saying it wanted to guarantee the rights of EU citizens and British nationals "as early as we can".
Ahead of the vote, the government made a last-minute attempt to persuade peers not to change the draft legislation.
Brexit Minister Lord Bridges said the government had been keen to reach an agreement with other EU nations on the issue.
However, he said, "a small number of our European counterparts" insisted there could be no discussions until the formal Brexit talks begin once Article 50 had been invoked.
But most peers wanted a unilateral move from the UK government.
Labour's shadow Brexit minister Lady Hayter said the concerns of EU nationals here and British expats living in Europe shouldn't be "traded against each other".
"These people need to know now - not in two years' time or even 12 months' time. They simply can't put their lives on hold."
Seven Conservative peers voted in favour of the amendment, which was proposed by Labour with the support of the Liberal Democrats.
Among those opposing it during the sometimes heated exchanges was former Conservative cabinet minister Lord Tebbit, who said the debate seemed to focus on "nothing but the rights of foreigners".