The US Senate has easily passed an immigration overhaul that would give millions of illegal immigrants a chance to become American citizens, as supporters brace for a battle with the House of Representatives.
The Senate on Thursday voted 62-36 for the bipartisan bill that couples border security and enforcement with a guest worker programme that would put most of the 11 million to 12 million illegal immigrants on a path to US citizenship.
It is the most sweeping immigration bill in two decades and Senate legislation has to be merged with a vastly different House bill that calls for tough border security and enforcement measures.
George W Bush, the US president, has said he supports a comprehensive approach to immigration reform along the lines passed by the Senate, but lawmakers acknowledged they still had more work to do.
"This product isn't perfect," said the Senate majority leader Bill Frist, a Tennessee Republican. "Much more refinement needs to be done."
Many politicians say Bush will have to become deeply involved in the bargaining for a final bill to be agreed upon before the November congressional elections when Democrats hope to make big gains. Recent polls show growing public dissatisfaction with the Republican majority.
The House bill became the focus of massive protests this spring across the country by mainly Hispanic immigrants seeking the right to remain and work in the US.
Bush is mindful of the growing clout of Hispanic voters and has long pushed for immigration reform and a guest-worker programme. But the issue divides Republicans and some Senate opponents said they would seek to rewrite the legislation during negotiations with the House.
They oppose provisions giving millions of illegal immigrants a chance to earn US citizenship. They also oppose a provision that would eventually allow some temporary workers to seek permanent status and citizenship.
"I am hopeful the House will save us from this bill," said Senator John Ensign, a Nevada Republican.
Supporters say they are optimistic.
"Some say the easy part of this debate is over, and now we face the hard part - reconciling the Senate bill with the House bill," said Senator Edward Kennedy, a Massachusetts Democrat who helped shepherd the bill through the Senate. "We'll do our best and I'm optimistic we can resolve our differences."
Politicians acknowledged negotiations will be difficult.
"The Senate has provisions that go far beyond (the House bill) and I don't underestimate the difficulties of the House and Senate trying to come together," House Majority Leader John Boehner, an Ohio Republican, said.
Backers of the Senate bill say it would not give amnesty to illegal immigrants because those seeking to legalise their status would have to pay a fine, back taxes and meet other requirements to qualify.