The bill, passed 62-36 despite a deep division within the majority
Republican Party, has the backing of President George W. Bush, but differs sharply from a parallel bill passed in the lower House of Representatives.
Approval of the Senate text with bipartisan backing of Republican John McCain and Democrat Edward Kennedy does not guarantee its final adoption.
"Today is not the day to celebrate. We have won a big battle but not the war," Senate Democratic leader Harry Reid said.
The bill would also create 200,000 temporary work visas for foreigners who take low-skill jobs and double the number of US Border Patrol agents on the border with Mexico.
It includes funding to build a 600 kilometre wall along the southern US frontier.
The Senate bill will be submitted to a bicameral negotiation, but will be difficult to bring into line with the much stricter version passed in the House of Representatives.
Crucial for Mexico
The consequences of the reforms are so great for Mexico that Mexican President Vicente Fox and first lady Marta Sahagun were in the United States on Thursday to address US-Mexican labor and immigration issues.
"This is a decisive moment and I am talking about a noble, sensitive and just cause," he said in Seattle, in the northwestern US state of Washington, where he was to visit a Boeing airplane factory. He will visit retailer Costco, coffee maker Starbucks and California Governor Arnold Schwarzenegger.
The US Chamber of Commerce welcomed the Senate text. "This bill constitutes a sound bipartisan legislative blueprint which addresses both the security and economic needs of the country," its vice president Randel Johnson said in a statement.
The bill aims to stem illegal immigration but welcome illegal immigrants who have already been integrated into US society. It is derided by some as an "amnesty".
"The problem with this bill is that it is an amnesty bill, or a legalisation bill, that I think is just fundamentally unfair to millions of people waiting around the world trying to get into this country legally, as well as the millions who have come into this country and waited and paid dearly, I might add, to come into this country legally," Senator Rick Santorum said.
Not so, said Senate Majority Leader Bill Frist: "We've taken a bill that the American people would have concluded was amnesty and by my lights, we took the amnesty out while we put the security in."
The Senate bill will be submitted to bicameral negotiations, but will be difficult to bring in line with a much tougher version passed in the House of Representatives.
The House bill has sparked some of the largest protests in recent US history, with millions of predominantly Hispanic demonstrators taking to the streets in major American cities since late March to defend their contribution to US society and the economy.
