The Senate voted overwhelmingly to impose a labor agreement between rail companies and their workers who have been locked in a stubborn stalemate, moving with uncommon speed to avert a potential holiday season rail strike.

President Biden made a personal appeal for Congress to act to impose a labor agreement that his administration helped negotiate, but that had failed to resolve the dispute. He was going to sign the bill quickly so that the economy wouldn't be hurt by a work strike.

It was the first time since the 1990s that Congress has used its power under the Constitution's commerce clause to intervene in a labor dispute. The step was a remarkable one for Mr. Biden, who vowed to be the most pro-union president you have ever seen, and for Democrats in control of Congress.

Mr. Biden and his allies on Capitol Hill have decided to support a resolution that they argue is needed to prevent painful consequences for Americans.

The vice president said in a statement after the vote that he was reluctant to overrule the union procedures. The consequences of a shutdown were too great for working families everywhere.

The action came a day after the House overwhelmingly approved the measure which would force the companies and their workers to abide by the tentative agreement. Wages will be increased by 24 percent over five years and there will be one additional paid day off. It was rejected because it didn't have paid sick leave.

Senate Democrats were under pressure to add seven days of paid medical leave to the agreement and failed to do so. It was defeated by a wide margin of 52 to 43, failing to get the 60 votes needed to pass.

Republicans wanted to extend the negotiation deadline by 60 days to give them time to work out a solution, but they didn't get enough votes. The proposal was defeated on a majority vote.

The agreement that the Biden administration negotiated was supported by a broad bipartisan group of people. The vote was 80 to 15 with Senator Paul votingpresent.

The Railway Labor Act, which allows the president to intervene in rail labor disputes that threaten to cut off transportation service, was championed by Mr. Biden.

Multiple unions voted against the deal because it didn't include paid sick leave and would force workers to take time off to attend medical appointments. It didn't go far enough to address the toll of difficult and unpredictable schedules.

Congress was asked to intervene by Mr. Biden with a railway strike imminent. He said it was necessary to address the threat of economic calamity by a disruption of the nation's rail system and an inability to swiftly transport goods and services because of his reluctance to overrule the will of union workers.

At a news conference on Thursday, Mr. Biden bristled at a question about why he had not insisted on more paid leave for rail workers in the deal. He wants paid leave for all Americans.

Congress has stepped into the middle of railroad labor disputes 18 times in the past century. They didn't like being called upon to accept a deal that was against what workers wanted. Mr. Biden sent Martin J. Walsh, the labor secretary, and Pete Buttigieg, the transportation secretary, to the Capitol to meet with Democratic senators.

Schumer said on the Senate floor that the consequences of not taking action would be severe. There would be serious problems if there was a rail shutdown, he said.

Republicans questioned why Mr. Biden didn't allow for more time to resolve the dispute before Congress.

The coalition that came together in opposition to the agreement was reflected in the final vote. Liberal senators, including Senator Elizabeth Warren of Massachusetts, voted against the bill.

The DC Republicans might want to do something for workers if they want to become a working class party. He was one of the conservative senators who supported the paid leave measure.

The House-passed proposal to add paid leave and the G.O.P. proposal for a cooling-off period will be considered first by the leaders.

The deadline extension was sponsored by Senator Dan Sullivan, a Republican of Alaska. He said his measure would give negotiators more time to get to an agreement and it wouldn't make Congress the last resort.

Some Republicans said the threat of damage to the nation's economy at a time when inflation is high drove their votes to implement the tentative agreement.

In a letter to their colleagues, Senators Cynthia Lummis of Wyoming and Kevin Cramer of North Dakota said that Congress must act. The most responsible path is to implement an agreement that half of the unionized workers support.

Ms. Lummis and Mr. Cramer were against adding paid leave to the agreement.

The two senators wrote that it was in the best interest of all parties that the railroads worked on issues such as paid leave with their employees.

Some liberals were frustrated by the push to impose the tentative agreement on workers and argued that paid leave was necessary. Manchin was the only Democrat to vote against the measure on the floor.

While I am sympathetic to the concerns union members have raised, I do not believe it is the role of Congress to negotiate a new collective bargaining agreement.

The overall agreement was in danger of being blocked without a vote to add paid leave.

The senator said that the idea was a conservative one. He said that he hoped that they would get strong support.

The proposal had a majority, but not the required supermajority.

Noam Scheiber and Zolan Kanno-Youngs were involved in the report.