WASHINGTON (CNN) -- The U.S. Supreme Court ruled Monday that federal judges have the discretion to give "reasonably" shorter prison terms for crack-cocaine crimes to reduce the disparity with crimes involving cocaine powder.

Lawyers argue that crack-cocaine offenders were unfairly targeted.

The 7-2 ruling represents a victory for lawyers who argued that crack-cocaine offenders were unfairly targeted under U.S. sentencing guidelines.

Current federal penalties for selling 5 grams of crack cocaine can warrant the same prison sentence as dealing 500 grams of the powdered variety.

The Supreme Court case centered around Derrick Kimbrough of Norfolk, Virginia, who according to court records, pleaded guilty to distributing more than 50 grams of crack cocaine. Federal sentencing guidelines called for 19 to 22.5 years behind bars. But Judge Raymond Jackson instead gave the defendant a 15-year sentence, calling the case "another example of how crack-cocaine guidelines are driving the offense level to a point higher than is necessary to do justice."

A federal appeals court overturned the case and sent it to a higher court, saying Jackson's discretion was "unreasonable when it is based on a disagreement with the sentencing disparity for crack and powder cocaine offenses."

Said Kimbrough's attorney, Michael Nachmanoff in October, "A sentence of 19 years for a man with no felony convictions who served his country honorably, who had never spent a night in jail ... that was ridiculous."

Kimbrough is a veteran of the 1991 Persian Gulf War and is African-American.

African-Americans were nearly 82 percent of defendants sentenced in federal court for dealing crack, but only 27 percent of those sentenced for dealing powder cocaine, according to 2006 federal statistics. Each year, federal courts handle about 11,000 cocaine sentences, which are roughly evenly divided between crack and cocaine cases.

The issue long has been a source of contention between government prosecutors and civil rights advocates, who argue crack dealers are often targeted for longer prison terms because that drug is prevalent in urban and minority communities, while the powdered version is more commonly associated with higher-income users.

Writing for the majority, Justice Ruth Bader Ginsburg took a practical approach, saying it is important to preserve judicial discretion, while ensuring most sentences remain within federal guidelines established two decades ago to ensure a measure of uniformity.

Ginsburg said a federal judge was right to give a crack offender a lesser prison term than the guidelines called for, since federal law "mandates only maximum and minimum sentences," she wrote. "It says nothing about appropriate sentences within those statutory guidelines."

Ginsburg noted the trial judge "honed in on the particular circumstances of Kimbrough's case and accorded weight to" reports by the U.S. Sentencing Commission that show "the crack/powder disparity yields unjustifiably harsh sentences for crack offenders."

Justices Clarence Thomas and Samuel Alito dissented in the Kimbrough case. Thomas said it will now be up to courts "to assume the legislative role of devising a new sentencing scheme," something Congress never intended.

The government had no immediate reaction to the high court's ruling.

The U.S. Sentencing Commission -- an independent federal agency that advises all three branches of government on sentences -- recently cut the gap in recommended prison time for crack-cocaine offenses. The guidelines took effect November 1 after Congress decided not to overturn the changes.

The commission is scheduled to vote Tuesday on whether to make those guidelines retroactive for prisoners convicted in the past of crack dealing.

Almost 20,000 inmates could be eligible for shorter sentences under the proposed changes.

Congress recently has introduced at least four bills that would reduce the current disparity in cocaine sentences. One widely circulated proposal led by Sens. Orrin Hatch, R-Utah, and Edward Kennedy, D-Massachusetts, would revise the cocaine ratio downward to 20-to-1. That ratio is also supported by the Sentencing Commission.

Harsher sentences for crack offenses came after a social epidemic of crack cocaine began destroying many urban areas in the 1980s.

"The crack-cocaine guidelines were put in place because crack was fueling crime waves across the country, in particular with respect to street violence," said Kendall Coffey, a former U.S. attorney in Miami who comments on legal matters for CNN. "And it is clear that crack cocaine and white powder cocaine had a very different impact in terms of not only the lives of the users but the impact on the community."

The case is Kimbrough v. U.S. (06-6330). E-mail to a friend

All About Cocaine • U.S. Supreme Court