U.S. senators on Thursday proposed a bipartisan plan for reforming criminal justice, aiming to ditch harsh sentencing laws that lead to prison overcrowding and to limit solitary confinement for juveniles.

The legislative proposal would end the national “three-strikes-and-you’re-out” law, which mandates life sentences for people convicted of a violent felony after two or more previous convictions, including drug crimes.

The proposal would also give judges more leeway in sentencing low-level offenders, and improve prisoner rehabilitation programs. But under the measure, enhanced prison penalties could still be applied to offenders with prior convictions for serious violent offences and serious drug felonies, a Senate fact sheet said.

The legislation was introduced by nine senators from both political parties, including Republican Chuck Grassley, chairman of the Senate Judiciary Committee, and Dick Durbin, the Senate’s No. 2 Democrat.

A separate bill in the House of Representatives would also reduce use of mandatory sentences.

The outlook for passage of either measure was uncertain.

President Barack Obama, who also favors criminal justice reform, welcomed the legislation.

“The broad and impressive bipartisan coalition that created the bill makes me optimistic that members on both sides of the aisle, in both houses, will continue to work together on this critical issue in the coming weeks and months and put a meaningful criminal justice reform bill on my desk before the end of this year,” Obama said in a statement.

Durbin said that while mandatory minimum sentences were once seen as a strong deterrent, they have too often been unfair, and led to overcrowded prisons and tighter budgets.

The drumbeat for reform has grown as U.S. crime rates have drastically declined over the past two decades. Lengthy prison sentences for nonviolent drug offenders are increasingly seen as racially imbalanced and disproportionate to the crimes.

President Barack Obama, a Democrat, also favors criminal justice reform. During the summer he toured a federal prison and vowed to work to address prison overcrowding.

More than 1.5 million Americans were in state or federal prisons at the end of 2013, according to the Bureau of Justice Statistics. African-Americans were 15 percent of the U.S. population at that time but accounted for about a third of its prisoners.