A House vote was expected on the bill within hours as lawmakers raced to wrap up their work for the year before Christmas. President Obama has said he looks forward to signing the measure, though some supporters of the bill have criticized him for not getting more involved in the fight.
The measure was a product of a compromise involving Democratic Sens. Charles Schumer and Kirsten Gillibrand of New York and Republican Sen. Tom Coburn of Oklahoma.
"The Christmas miracle we've been looking for has arrived," Schumer and Gillibrand said in a joint statement.
The 9/11 legislation provides money for monitoring and treating illnesses related to Ground Zero and reopens a victims'
compensation fund for another five years to cover wage and other economic losses of sickened workers and nearby residents. Schumer and Gillibrand had sought $6.2 billion and keeping the compensation fund open for 10 years.
"Every American recognizes the heroism of the 9/11 first responders, but it is not compassionate to help one group while robbing future generation of opportunity," said Coburn, who led a GOP blockade against the bill. "This agreement strikes a fair balance."
The bill gained momentum with help from cable TV personalities. Among the biggest champions of the package were Fox News anchor Shepard Smith and comedian and activist Jon Stewart, who championed the bill and lashed its GOP foes on his Comedy Central TV program "The Daily Show."
New York Mayor Michael Bloomberg praised Congress for finally hammering out a bill.
"As we look forward to the 10th anniversary of the September 11th attacks, I am encouraged that our elected representatives in Washington came together and stood by those who were there for America in its hour of greatest need," Bloomberg said.
The compromise was reached after Democrats scheduled a showdown test vote for Wednesday afternoon and Republicans countered by threatening to run a 30-hour clock before allowing final Senate and House votes on the bill. That would have required keeping both the Senate and House in session for votes on Christmas Eve.
Backers worried that the bill would face a much tougher fight in the new, more fiscally conservative Congress where Republicans will have a stronger hand.
"Any single senator can hold this up way past Christmas and we know that can kill the bill," Schumer said on MSNBC's "Morning Joe" program Wednesday.
Nearly 16,000 responders and 2,700 people living near ground zero are currently sick and receiving treatment, supporters of the bill said. More than 40,000 responders are in medical monitoring, backers said.
The bill would be paid for with a fee on some foreign firms that get U.S. government procurement contracts. The bill also calls for extending fees on certain firms that rely on H-1B and L-1 visas.
Researchers have found that people exposed to the thick clouds of pulverized building materials at the trade center site have high rates of asthma and sinus problems. Many firefighters also suffered a reduction in lung power.
Doctors aren't sure, though, exactly how many people are ill, and scientific doubt persists about just how many of the hundreds of illnesses are actually linked to the trade center dust. Doctors still don't know whether there is any connection between the dust and potentially fatal illnesses like cancer.
The legislation is named for James Zadroga, a police detective who died at age 34. His supporters say he died from respiratory disease contracted at ground zero, but New York City's medical examiner said Zadroga's lung condition was caused by prescription drug abuse.
Associated Press writers Donna Cassata and Laurie Kellman contributed to this report.