The US Senate has passed a broad immigration reform bill that includes a path to citizenship for an estimated 11 million undocumented immigrants.
The 68-32 vote comes after months of debate and a recent deal to boost border security spending significantly.
But the legislation faces a tough road in the more conservative House.
House Speaker John Boehner has said he will not advance legislation that lacks support of most of his fellow Republicans, who remain resistant.
After the bill's passage on Thursday, President Barack Obama said the vote brought the US "a critical step closer to fixing our broken immigration system once and for all".
"Today, the Senate did its job," Mr Obama said in a statement. "It's now up to the House to do the same."
Mr Obama has made immigration a top priority for his second term, asking Congress to deliver a bill for him to sign by autumn.
As the vote was held on Thursday afternoon, Senate Majority Leader Harry Reid, a Democrat, made the rare request of asking all 99 of his colleagues to be present and to vote from their desks.
"This is not a vote where people should be straggling in," Mr Reid said.
After the vote, members of the bipartisan group that negotiated the original bill, known as the Gang of Eight, thanked the broad coalition that had backed immigration reform efforts.
One member of the group, Democratic Senator Dick Durbin, said the voices of young undocumented immigrants "had made a difference".
Republican Senator Lindsey Graham said the bill's border security measures had "exceeded every expectation I had", and said the bill had "practically militarised the border".
Forward movement on the bill comes shortly after two Republican senators this week brokered a compromise to increase border security spending by $38bn (£24bn). That amendment to the bill added an additional 20,000 border security agents, new fencing, electronic surveillance, and unmanned drones and passed on Wednesday.
'Our own bill'
Earlier, the non-partisan Congressional Budget Office estimated the legislation, without the increased border funds, would reduce the US budget deficit by $175bn (£114bn) over 10 years and boost economic growth.
And analysts say many Republicans acknowledge that support for immigration reform will be critical for their future election prospects as Hispanics become an increasingly important voter bloc.
On Thursday, Mr Boehner, the Republican House speaker, said the House would not take up the Senate bill directly.
"We're going to do our own bill... that reflects the will of our majority and the will of the American people," he said.
Mr Boehner's comments cast doubt on the chances legislation will quickly reach Mr Obama's desk, and could portend failure for immigration reform entirely, analysts say.
Separate bills designed by House Republicans include stricter border and interior security measures, employment checks and most significantly, no path to citizenship for undocumented immigrants.
Some Republicans believe a path to citizenship rewards those who broke the law by immigrating to the country illegally.
Senator Chuck Grassley, who voted against the Senate bill, said he was counting on the House to pass legislation that is "much more tough".