The voice vote in the nearly empty Senate chamber sends the legislation to President Barack Obama, who has urged Congress to channel more money toward border security amid complaints from border states besieged by undocumented immigrants and illegal drug trafficking.
Sen. Charles Schumer, D-N.Y., the chief sponsor, said the measure would provide Obama and Homeland Security Secretary Janet Napolitano "with the boots on the ground and the resources necessary to combat the crime and violence."
Obama said the bill would help protect communities along the Southwest border and across the country.
"And this new law will also strengthen our partnership with Mexico in targeting the gangs and criminal organizations that operate on both sides of our shared border," he said in a statement.
House Democrats had also called a special session, summoning lawmakers back from their summer break Tuesday to pass the border security bill and a $26 billion aid bill to keep teachers and other public workers from being laid off. Both issues -- jobs and border security -- are among those expected to be on voters' minds when they go to the polls in November.
Senate historian Donald Ritchie said it was only the second time since the August break became official policy in 1970 that the Senate had reconvened. The first time was after Hurricane Katrina in 2005.
The border security measure would fund the hiring of 1,000 new Border Patrol agents to be deployed at critical areas along the border, 250 more Immigration and Customs Enforcement agents, and 250 more Customs and Border Protection officers.
It provides for new communications equipment and greater use of unmanned surveillance drones. There are currently seven such drones along the border. Almost one-third of the money goes to the Justice Department to help agencies such as the FBI, the DEA and the ATF deal with drug dealers and human traffickers.
The bill is paid for by raising fees on foreign-based personnel companies that use U.S. visa programs, including the popular H-1B program, to bring skilled workers to the United States. India says higher fees would discriminate against its companies and workers.
Arizona Republican Sens. John McCain and Jon Kyl called the legislation a start. But, in a statement, they said the bill fell short by not dramatically increasing the number of customs inspectors along the Arizona border and not funding a program that charges illegal immigrants with low-level crimes and requires them to spend time in jail.
It's taken the House and Senate several tries over the past months to agree on the contents of the bill and how it should be paid for. Rep. Ann Kirkpatrick, D-Ariz., said that throughout this legislative back-and-forth she had worked "to make sure that Congress knows that we are fed up with the federal government's failure along the border." She said that with Senate action, "at least this time, they are listening to us."
Arizona has been at the epicenter of the border security debate since it passed a law directing law enforcement officers to be more aggressive in seeking out illegal immigrants. Although a federal judge has since struck down some of the law's major provisions, it remains a rallying cry for those who say Washington has lost control of the border.
Both the Obama administration and congressional Democrats say they are committed to more comprehensive immigration legislation, including steps to create a pathway to citizenship for the estimated 11 million illegal immigrants already in the country. But the issue has made little headway, pushed aside by other priorities such as health care and failing to gain bipartisan support in the Senate.
"Both moderate Democrats and Republicans said they wouldn't even consider comprehensive reform until we did something about the border," Schumer said. He said the bill "will clear the path for restarting the bipartisan discussions we absolutely need to have for restoring the rule of law to our entire immigration system."