The 411-0 vote sent the bill to President Bush.
The House already had passed the bill twice. "The third time is the charm," said Rep. James Sensenbrenner, R-Wis., the House Judiciary Committee chairman.
The House had been holding up the bill because the Democratic-controlled Senate wanted a provision to allow the Justice Department to ignore federal bidding requirements on a computer system to be used by government agents for screening visa applicants.
The chairman of the House Government Reform Committee, Rep. Dan Burton, R-Ind., objected to the exemption. The Senate, early Tuesday, authorized the House to take the language out to clear the way for House action.
Mr. Bush is expected to sign the bill, which has been stalled in Congress since December.
"This is important and long overdue legislation," Sensenbrenner said.
The border security bill would boost the pay of border patrol agents and allow the Immigration and Naturalization Service to hire 200 new investigators and another 200 inspectors.
It also would require the INS to establish a foreign-student tracking system that records the acceptance of aliens by educational institutions, the issuance of student visas and the enrollment of aliens at schools. Several hijackers involved in the September attacks were in the country on student visas.
The legislation "addresses some gaping holes in the system, that even without the horrific tragedy of Sept. 11, it was our responsibility to address," said Rep. Sheila Jackson Lee, D-Texas.
The bill would also require that passports issued after 2003 be tamper-resistant and that visitors carry documents that can be read by machine and identify the bearer with biometrics, such as face recognition or retinal scanning technology.