Early in the week, Joe Biden gave a speech in Michigan and described himself as an unabashed champion of organized labor, a "pro-union" president through and through.
Now Biden faces a backlash from a core of rail workers and allied groups, as some of them see a betrayal in the bill he pushed to avert a rail strike.
He signed the measure, which passed with bipartisan support, at the White House on Friday, giving rail workers a significant raise, but denying them the paid sick leave that had been a sticking point in some of the contract talks. Hours later, he arrived at the John F. Kennedy Library in Boston and was met by scores of protesters objecting to his handling of a labor dispute that threatened to halt rail service at the peak of the holiday season.
Biden might be willing to tolerate the anger in the hope that it fizzles out before he has to face voters again. And it may be better for him than the alternative - an economic calamity that could have enraged voters across the country and worsened inflation.
Supporters argue Biden's decisive action may be a net positive, proof that he's willing to do what is best for the nation, even if it upsets some members of a key constituency.
The standoff between rail workers and the profitable companies that employ them posed an awkward dilemma for Biden, forcing him to find an elusive middle ground between dueling campaign pledges.
He has promised to be a friend to a labor movement that he says created the American middle class. But he has also vowed to build on the post-pandemic economic recovery and strive for bipartisan compromise. A rail strike threatened to unravel the job gains that no doubt will be central to any Biden re-election campaign.
"If Joe Biden wants to be the most pro-labor president, or wants to deem himself a labor supporter, he's got to stand with labor through thick and thin, when it's complicated and when it's not," said Tony Cardwell, president of the BMWED, one of the four unions that voted against the deal with the rail companies (eight others voted for the contract). "We're asking for something that most Americans have."
At the bill signing ceremony, Biden sounded torn. He said he is not giving up on paid sick leave for rail workers and other Americans who don't receive such benefits. But he made it clear that he was not prepared to see freight trains stopped and food, water, clothing and holiday gifts stranded in empty depots. Lawmakers faced a tough vote, he said, adding it was "a tough [vote] for me. But it was the right thing to do at the moment to save jobs. …"
Still, the president could have used more leverage to reach a deal that included paid sick leave, union officials and allies contend.
"I'm disappointed that he [Biden] wielded his power against workers," said Erin Hatton, a sociology professor at the University of Buffalo, who specializes in labor markets."He pitted workers against the economy. But workers are the economy.
"Biden has run on a pro-labor platform from the beginning and this, in my view, makes it impossible for him to do so in the future," she said.
Other unions worry that the rail dispute could further weaken the hand of the nation's labor movement, or sap its recent momentum - potentially giving industry new avenues to win future concessions.
Sara Nelson, the president of the Association of Flight Attendants union, which also bargains under the same labor laws as rail workers, said that the move to preempt the strike could potentially hamper her workers as well, many of whom are in the midst of negotiating with the major airlines.
"This was a direct attack on the right to strike for the people I represent," she said. "The message they're sending is that they are siding with bosses whether they intend it or not. Fair collective bargaining includes the right to strike, so everyone has something to lose."
White House economics official Celeste Drake defended the move to avert the strike.
"President Biden utilized the full weight of his administration to support rail union members in their work to negotiate improved wages, benefits and working conditions in an agreement that earned support from a majority of rail worker unions," she said. He's proud of his record as a pro-union president and will continue fighting to deliver paid sick leave, dignity at work and other wins for working Americans."
Pragmatic-minded Democrats and other union supporters said Biden displayed an important quality through the rail saga: flexibility. He campaigned on unifying the country and reaching bipartisan solutions - something that's especially tough to do given that most legislation needs a 60 vote supermajority to pass the Senate, meaning at least 10 Republicans have to join the Democrats.
"What the American people saw the president do was make an extremely difficult choice that he knew was going to upset a group of supporters, and one of the groups that he cares most about personally, because he thought it was the right thing to do, and the right thing to do for our economy," said Seth Harris, a former top Biden adviser on labor.
Cleveland conductor Dan Banks, 43, a member of one of the unions that voted down the deal, said he had hoped for paid sick days but didn't blame Biden for the setback.
He believed the president had pushed hard for a resolution with the understanding that rail workers would have faced a worse outcome if the negotiations stretched into January, with Republicans set to take over the House in 2023.
"Biden made sure we got what was available to us," he said.
Biden has worked to make good on the vow to be the most pro-labor president in memory, earning early applause from labor activists and economists pushing for a more robust role for unions. He made waves by releasing a video early in his presidency supporting Amazon workers organizing in Alabama and warning the company about anti-union activity. And he has installed a set of largely pro-labor voices in key positions at the Department of Labor and the National Labor Relations Board.
But some of the more ambitious parts of his agenda, such as passing the Pro Act to update the country's dated labor laws and expanding paid leave, have sputtered in a closely divided Congress with its own arcane set of voting rules.
These tensions came to a head as rail negotiations soured in the past six months. A Senate bill that would have guaranteed seven days of paid sick leave for workers received 52 votes on Thursday, falling short of the 60-vote threshold needed for passage.
From the start of the talks between the White House and rail unions in the contract dispute, there was concern about how at least 10 Republicans could be persuaded to support a pro-labor deal if negotiations failed, one person with knowledge of the nearly year-long discussions said.
"If they could not reach an agreement with the rail companies, how would unions get to 60 on agreement in Congress?" the person said. "That's where they ended up and they couldn't. None of this was a surprise to anyone involved in the process."
Still, some saw the White House taking the sides of industry leaders - who had warned about the economic consequences of a strike for months - over working men and women on the rails.
"The president was in a hard place, trying to maintain safe supply chains and get people their Christmas presents," said Faiz Shakir, an adviser to Sen. Bernie Sanders of Vermont, "but what workers have felt for the past few decades is they're always getting the shaft."
This article was originally published on NBCNews.com