The House of Lords has handed Prime Minister Theresa May's government its first defeat on the road to Brexit, amending the Article 50 Bill to include a unilateral guarantee of the rights of EU citizens to remain in the UK.
Peers voted 358 to 256 in favour of a change to the Bill, which passed through the House of Commons unamended.
Reforms by peers force the government to reconsider legislation, but still require the approval of the House of Commons.
If MPs do not agree to peers' amendments, it will be returned to the House of Lords for further debate.
A spokesman for the Brexit department 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.
“Our position on EU nationals has repeatedly been made clear. We want to guarantee the rights of EU citizens who are already living in Britain, and the rights of British nationals living in other member states, as early as we can.”
The vote came after hours of impassioned debate among peers, launched by Labour's Baroness Hayter, who accused the government of seeking to “do negotiations with people's futures”.
The majority of the peers spoke in favour of the changes, although the comments were not unanimously supportive.
Former Conservative leader Lord Howard was among the critics, arguing that amending the Bill only delayed Brexit negotiations, further extending uncertainty for EU nationals.
Similarly, former Tory minister Lord Tebbit and Migration Watch founding chair Lord Green were among the peers to question the impact for British citizens overseas.
"In the real world, if our negotiating partners are assured in advance that the requirements of their own citizens have already been satisfied, it is inevitable that the issues relating to British citizens in their countries will slip down the agenda, which is already very long and very complicated," Green said.
And the debate was closed on a similar note by Brexit minister Lord Bridges, who sought to reassure peers by noting the legal status of EU nationals who have been in the UK for more than five years, and stressing the government would bring a further immigration Bill before parliament to enact any changes.
"Nothing, nothing, will change for any EU citizen without parliament's approval," Bridges said, but it was not enough to secure peers support.