The US Senate has passed a major bill which paves the way for millions of illegal immigrants to seek citizenship in the country.
Immigrant groups have held rallies in support of the reforms
Senators voted 62-36 to approve the legislation, which also includes measures to increase border security.
The bill is backed by President George W Bush - but will have to be reconciled with tougher measures approved by the House of Representatives last year.
About 11.5 million illegal immigrants live in the United States.
Many of them are Mexicans - who have the support of the Mexican government.
Mexican President Vicente Fox told the California Legislature on Thursday that the Senate's vote was a "monumental step forward".
But he said the problems of immigration would not be solved just by "building walls" - a reference to the bill's provision for a huge border fence to be erected on the US-Mexican border.
The issue of immigration has sparked fierce debate in the US and is high on the agenda as Republicans seek to retain control of Congress in November's mid-term polls.
The debate has also energised the streets, with hundreds of thousands of people - many of them Hispanic - demonstrating in Los Angeles, Chicago and elsewhere. They are demanding recognition for the role they say immigrant workers play in the American economy.
Anti-immigration groups have begun patrolling US borders and confronting illegal workers in cities around the US.
The Senate bill combines tougher border security with ways of allowing some illegal immigrants to seek US citizenship, and provisions for guest-worker programmes.
"Why not say to those undocumented workers who are working the jobs that the rest of us refuse, 'come out from the shadows'," said Arizona Senator John McCain, a Republican and leading supporter of the bill.
The reforms are the most sweeping in two decades but are at odds with the measures passed by the House of Representatives, which wants illegal immigration to be criminalised and tougher enforcement measures.
"I am hopeful the House will save us from this bill," said Republican Senator John Ensign, from Nevada.
There is widespread resistance from both the Republicans and the Democrats, and tough negotiations are expected before all sides can reach an agreement on the reforms.
The Senate bill will have to be reconciled with the House bill before it can be signed into law by the president.