WASHINGTON — Thousands of emergency workers who rushed to the rubble of the World Trade Center after the Sept. 11 attacks will be granted health care and other compensation for the rest of their lives. The Senate on Tuesday gave final approval to legislation that would care permanently for those who have grown deathly ill from the toxins of ground zero.

White House officials said President Trump was expected to sign it. Even before the Senate’s 97-to-2 vote was gaveled to a close, retired New York firefighters and police officers, advocates and Jon Stewart, the comedian who championed the legislation, had leapt to their feet in the usually hushed chamber to lead a standing ovation.

Outside, they choked back tears, embraced and clapped one another on the back.

“The country has moved on, and rightfully so,” said Michael O’Connell, a retired lieutenant with the New York Fire Department. But “it’s in front of our eyes,” he added. “We’re in hospices. We’re seeing people pass away right in front of our very eyes.”

“It’s nice to know that they’ll be taken care of,” he concluded.

The legislation would ensure that the September 11th Victim Compensation Fund is funded for the next seven decades at a cost of $10.2 billion over the next 10 years. It would offer financial stability as the number of medical claims from emergency personnel who worked for months in Lower Manhattan after the 2001 attacks surpasses 22,000.