WASHINGTON — Legislation to avert what could have been an economically ruinous freight rail strike won final approval in Congress on Thursday as lawmakers responded quickly to President Joe Biden’s call for federal intervention in a long-running labor dispute.

The Senate passed a bill to bind rail companies and workers to a proposed settlement that was reached between the rail companies and union leaders in September. That settlement had been rejected by four of the 12 unions involved, creating the possibility of a strike beginning Dec. 9.

The Senate vote was 80-15. It came one day after the House voted to impose the agreement. The measure now goes to Biden’s desk for his signature.

“Communities will maintain access to clean drinking water. Farmers and ranchers will continue to be able to bring food to market and feed their livestock. And hundreds of thousands of Americans in a number of industries will keep their jobs,” Biden said after the vote. “I will sign the bill into law as soon as Congress sends it to my desk.”

The Senate voted shortly after Labor Secretary Marty Walsh and Transportation Secretary Pete Buttigieg emphasized to Democratic senators at a Capitol meeting that rail companies would begin shutting down operations well before a potential strike would begin. The administration wanted the bill on Biden’s desk by the weekend.

Shortly before Thursday’s votes, Biden defended the contract that four of the unions had rejected, noting the wage increases it contains.

“I negotiated a contract no one else could negotiate,” Biden said at a news briefing with French President Emmanuel Macron. “What was negotiated was so much better than anything they ever had.”

Critics say the contract that did not receive backing from enough union members lacked sufficient levels of paid sick leave for rail workers. Biden said he wants paid leave for “everybody” so that it wouldn’t have to be negotiated in employment contracts, but Republican lawmakers have blocked measures to require time off work for medical and family reasons. The president said Congress should impose the contract now to avoid a strike that he said could cause 750,000 job losses and a recession.

Railways say halting rail service would cause a devastating $2 billion-per-day hit to the economy. A freight rail strike also would have a big potential impact on passenger rail, with Amtrak and many commuter railroads relying on tracks owned by the freight railroads. (AP)