WASHINGTON — A major criminal-justice overhaul bill seemed destined to be the bipartisan success story of the year, consensus legislation that showed lawmakers could still rise above politics.
Then the election, Donald J. Trump’s demand for “law and order” and a series of other political calculations got in the way.
Senate Republicans divided on the wisdom of reducing federal mandatory minimum sentences. Other Republicans, unhappy that President Obama was reducing hundreds of federal prison sentences on his own, did not want to give him a legacy victory. A surge in crime in some urban areas gave opponents of the legislation a new argument.
What remains is a stunning display of dysfunction given the powerful forces arrayed behind legislation meant to provide a second chance for nonviolent offenders facing long prison sentences while also saving tax dollars on prison costs.
Speaker Paul D. Ryan is on board. The quarrelsome Senate Judiciary Committee passed its bill on a strong bipartisan vote with the imprimatur of Senator Charles E. Grassley of Iowa, the Republican chairman. Mr. Obama considers the issue a top priority.
“It is one of the things that makes this a frustrating place to work,” said Senator John Cornyn of Texas, the No. 2 Republican in the Senate, who became a believer in a new approach to criminal justice after seeing the benefits in his home state.
Mr. Cornyn concedes the tumult of this election year was a major factor given sharp disagreement among Senate Republicans reflected in the decision by Senator Mitch McConnell, Republican of Kentucky and the majority leader, to not allow a vote on a proposal most believe would pass easily.
“I think that Senator McConnell understandably did not want to tee up an issue that split our caucus right before the 2016 election,” said Mr. Cornyn, who noted that aspects of the legislation had been misconstrued by its critics.
Presidential politics were at work as well. Mr. Trump has been campaigning on warnings of a United States at risk from sinister forces, even though violent crime is low compared with past decades. But crime surges in some urban areas have given opponents of the legislation ammunition to challenge it.
“This is not a partisan issue,” Mr. Cornyn said. “No matter what happens in November, I think this is still very much alive and achievable. Some things just take a while.”