WASHINGTON — After a popular bill to improve prison education and training programs breezed through the House last May, criminal justice reformers in the Senate faced a crucial choice: run with it or hold out for more far-reaching changes to sentencing laws.
The two main proponents of a sentencing overhaul — Senator Charles E. Grassley, the conservative Iowa Republican who is the chairman of the Judiciary Committee, and Senator Richard J. Durbin of Illinois, the liberal No. 2 Senate Democrat — agreed between themselves to sit tight. They insisted that any final legislation must include proposals in a Senate bill to cut the mandatory minimum sentences imposed in an antidrug crackdown decades ago or there would be no legislation at all.
“We had worked so darned hard and got such an overwhelming vote to get the bill out of committee, why should we settle for less than the whole package we had been working on for two years?” Mr. Grassley said in an interview.
It paid off. President Trump on Wednesday endorsed a measure that included the sentencing provisions written by the two senators and a handful of others, including Senator Mike Lee, Republican of Utah. It was a major step forward for legislation that has united forces on the left and right but has still struggled to overcome resistance from Republicans who believe it goes against the party’s tough-on-crime image.
“We have the Fraternal Order of Police and the A.C.L.U.,” Mr. Durbin said, ticking off some of the bill’s diverse backers. “How often do you see this alliance?”
Yet the success of the bill, which was put into final form on Thursday, is not guaranteed. Opponents, both in the Senate and the law enforcement community, were stepping up their criticism, and more important, Senator Mitch McConnell’s willingness to bring the measure to the floor remained in question. Despite strong bipartisan support, Mr. McConnell, the Kentucky Republican and majority leader, refused to allow a vote on the bill before the 2016 elections, worried about sowing divisions among Republicans. And he may do the same thing now.
Mr. Grassley said he had received strong assurances from Mr. McConnell in recent meetings that if the bill’s backers could show that they had, at a minimum, the 60 votes needed for passage, he would put it on the floor despite his own reservations. Mr. Grassley now wants his leader to follow through.
“I think it deserves a floor vote and McConnell should honor his indication that he gave us that he would bring it up if we could show the votes,” Mr. Grassley said.
Both he and Mr. Durbin see Mr. McConnell as their main obstacle. They said they had already received assurances from Republican officials in the House that the measure would get quick approval there. And if that happens, it could mark a bipartisan exclamation point for Speaker Paul D. Ryan, a supporter of the Senate bill who is leaving at the end of the session, as well as Mr. Grassley, who may give up his chairmanship of the Judiciary Committee at the same time.
Mr. Grassley said the criminal justice overhaul would give the president a chance to claim a bipartisan victory, noting that Mr. Trump is a “president who needs a lot of help” when it comes to bipartisanship. And he pulled out another argument intended to draw Republican backing.
“I hope they would understand that we have a chance to do something that President Obama couldn’t get done,” he said.
Leaders of advocacy groups behind the criminal justice legislation agree that the pact between Mr. Grassley and Mr. Durbin was essential to the final agreement’s coming together.
“Grassley and Durbin holding firm was pivotal,” said Holly Harris, executive director of Justice Action Network, a main proponent of the sentencing overhaul.
They were helped by one of the conservative groups behind the measure, FreedomWorks, which backed the view of the senators that any measure should contain both improvements in prison programs and changes to sentencing laws.
Jason Pye, vice president of legislative affairs at the group, said he had pressed for sentencing changes as part of a package during an April meeting at the White House with top administration officials, including Jared Kushner, the president’s son-in-law and senior adviser, who is a proponent of sentencing changes.
“I made it very clear that I thought they weren’t going to get this done without sentencing added,” Mr. Pye said.
The two senators stuck together despite being fierce combatants over the Supreme Court nomination of Brett M. Kavanaugh, with the two sparring over everything from document disclosure to Judge Kavanaugh’s character.
“Carrying yesterday’s battle into today’s battle is a mistake,” Mr. Durbin said. “When we reached agreement on this, it was solid. I may disagree with him vehemently, but his word is his bond.”
Mr. Grassley acknowledged that the confirmation fight pitted them against each other, but that Mr. Durbin “was a tremendous person to keep his word and work with me” despite the court confrontation.
Their job now is to corral the necessary votes. They spent Thursday meeting with lawmakers to produce the support needed to try to force Mr. McConnell’s hand.
Some Democrats might not be inclined to help Mr. Trump claim a significant bipartisan achievement or could argue that the legislation has been too diluted through negotiations with Republicans and the White House. But Mr. Durbin said he was increasingly confident that the legislation would get a strong Democratic vote of support, and Senator Cory Booker, the New Jersey Democrat, was among those who came on board Thursday.
“This bill is not perfect,” he said. “Clearly, I want so much more, but I am not going to let perfect be the enemy of the good when the lives of thousands of people are in the balance.”
Mr. Grassley is lining up Republicans, highlighting the backing of leading law enforcement groups and negotiations that tightened safeguards against letting dangerous offenders qualify for early release.
Still, Republican resistance remains and could influence Mr. McConnell. The office of Senator Tom Cotton, the Arkansas Republican and leading opponent of the legislation, on Thursday circulated a letter from organizations representing elected sheriffs that raised objections to the bill.
Without changes, the letter said, the “legislation creates a high-risk path for dangerous criminals with gun crime histories to early release from prison. This amounts to a social experiment with the safety of our communities and the lives of sheriffs, deputies and police officers in the balance.”
Some Republicans rejected the criticism. “I would say it is a dangerous experiment to basically incarcerate people for 30 and 40 years for nonviolent offenses at a time when we need workers,” said Senator Lindsey Graham, Republican of South Carolina.
Mr. Grassley said that such consequential legislation would always have its detractors, and that he hoped to ultimately produce 65 to 70 votes in the Senate for the legislation.
“Something like this is done once in a generation,” Mr. Grassley said. “If we get this done, it is the biggest reform of sentencing in criminal justice in at least 30 years.”