The US Senate has followed the House of Representatives in approving a far-reaching overhaul of the country's intelligence agencies.
The changes are intended to bolster intelligence to prevent terror attacks
The bill, intended to prevent a repeat of the 11 September attacks, now goes to President Bush for final approval.
It will lead to the creation of a national intelligence director to oversee the work of the 15 US security agencies, including the CIA and FBI.
Intelligence officials will also be granted greater surveillance powers.
The changes will represent the most radical shifts in the US intelligence system since the end of the Cold War.
In effect, a single individual will be put in charge of co-ordinating the work of the country's spy agencies, as well as their multi-billion dollar budgets.
The bill, which was approved by the House of Representatives earlier, also creates a national counter-terrorism centre.
The bill also contains provisions to allow operatives to place wiretaps on suspected terror suspects and to improve the efficiency of baggage screening equipment at borders and airports.
US INTELLIGENCE BILL
Establishes director of national intelligence
Creates a national counter-terrorism centre
Sets up a civil liberties board
Increases border patrols
Tightens visa requirements
Strengthens rights to investigate terror suspects
Around 2,000 extra border guards will be recruited for each of the next five years.
The legislation also calls for face-to-face interviews for almost all foreign applicants for US visas.
The bill was the result of the year-long investigation by the bipartisan 9/11 Commission.
The inquiry found the country's intelligence agencies failed to share information and were often engaged in bureaucratic competition.
Such weaknesses, it concluded, were partly to blame for the failure to prevent the 11 September 2001 terror attacks on New York and Washington.
The BBC's Justin Webb in Washington says President Bush lobbied hard for the core proposals, knowing they had broad public approval.
But some senior Republicans had baulked at the plans, fearing they could hamper the Pentagon's independent intelligence-gathering abilities.
House Armed Services Committee chairman Duncan Hunter was concerned the new intelligence director might insert himself into the chain of command between the president and military leaders.
The bill was amended to clarify the president's control of the military.
Other critics wanted additional domestic measures, such as denying drivers' licences to illegal immigrants.
Intensive lobbying by members of the 9/11 Commission and families' representatives kept pressure on Congressmen throughout the US presidential election campaign.
After the bill was approved by the House, Mr Bush's office said he was "very pleased"
"He knows that
this bill will make America safer," White House spokesman Trent
Families lobbied Congress hard to implement changes
Senator Jay Rockefeller, the senior Democrat on the influential Senate Intelligence Committee, welcomed the bill, saying that if it had existed in 2001, "we might have had a chance not to go through the horrible experience that we did on 11 September".
But some Republicans said that despite the amendments, they still opposed the entire
bill because they saw it as useless.
"I believe creating a national intelligence director is a
huge mistake," said Representative Ray LaHood, an Illinois
"It's another bureaucracy, it's another layer
of government. It would not have prevented 9/11 and it will
not prevent another 9/11."