Legislation that would ease federal sentencing laws for some offenders cleared its first major test vote Monday, garnering overwhelming support in both parties even as some conservatives portrayed the bill as soft on crime.

The Senate voted 82-12 to advance the bill. A vote on final passage would come later in the week, but not until the chamber has debated and voted on a series of amendments from opponents that will be brought up Tuesday.

The bill would give judges more discretion when sentencing drug offenders and allow about 2,600 federal prisoners sentenced for crack cocaine offenses before August 2010 the opportunity to petition for a reduced penalty. The bill also encourages prisoners to participate in programs designed to reduce the risk of recidivism, with the reward being the accumulation of credits that can be used to gain an earlier release to a halfway house or home confinement to finish out their sentence.

To win over wary senators, sponsors tweaked the bill to prevent those convicted of violent firearm offenses, sexual exploitation of children and high-level fentanyl and heroin dealing from participating in the supervised release program -- but Senator Tom Cotton, R-Ark., and others want to expand that list.

Their amendment would add carjacking, bank robbery by force, felony sex crimes and other "felony crimes of violence" to the list of offenses that make a prisoner ineligible.

"Some of those crimes should not be eligible for that program," said Sen. Mike Rounds, R-S.D. "At this point, I'm probably a no unless they get that done."

Cotton has been among the most vocal opponents of the legislation, saying: "If other senators want to vote for a bill that's going to let sex offenders and child pornographers and wife-beaters out of prison, that's their prerogative. That's between them and the voters in their state."

The bill has created a unique split in the GOP camp, while Democrats are overwhelmingly supportive.

Republican Sen. Mike Lee of Utah, a former federal prosecutor, is among the bill's champions. He said he has been haunted by the words of a federal judge who sentenced a low-level drug offender carrying a gun to 55 years in prison, noting that murderers, rapists and terrorists could get less time for their offense. He said only Congress could fix the problem.

"Those comments have stayed with me ever since," Lee said.

The bill follows the lead of states such as Texas that have experienced a decrease in crime in recent years while keeping fewer people in prison. Sen. John Cornyn, R-Texas, said his home state has been able to close eight prisons since undertaking various prison reforms, such as investing in probation staffing and getting prisoners into drug treatment more quickly.

"This is not about being tough on crime, or soft on crime," Cornyn said. "This is about being smart on crime and getting the best results."

Supporters of the bill warn that amendments from Cotton and Sen. John Kennedy, R-La., could cause the compromise to unravel if the Senate approves any of them as early as Tuesday. A unique cross-section of liberal and conservative advocacy groups have rallied in support of the bill.

David Safavian, general counsel for the American Conservative Union, said the bill's critics ignore that offenders would be subject to strict oversight while completing their sentence at halfway houses or in home custody. The prisoners also have to show through objective criteria that they are a low risk to society before obtaining supervised release.

Under the current process, nearly half of released federal prisoners are arrested again.

"And every case of recidivism is another victim, is another crime, is another prosecution, is another trial, is another prison cell, all funded with taxpayer dollars," Safavian said. "I'm sorry, but there is nothing conservative about protecting a non-functioning prison bureaucracy."

If the legislation passes the Senate, the House is expected to approve it quickly. The House had earlier passed legislation that focused on boosting prisoner rehabilitation programs but did not include changes to sentencing laws that critics say had led to overly harsh sentences for many nonviolent offenders, particularly African-Americans.

The bill looked to have stalled a couple weeks ago, but supporters led by President Donald Trump and son-in-law Jared Kushner persuaded Senate Majority Leader Mitch McConnell, R-Ky., to allow for the Senate vote before Congress adjourns.