By a 7-2 vote, the court said that a 15-year sentence given to Derrick Kimbrough was acceptable, even though federal sentencing guidelines called for him to receive 19 to 22 years, news agencies reported.
"In making that determination, the judge may consider the disparity between the guidelines' treatment of crack and powder cocaine offenses," Justice Ruth Bader Ginsburg wrote in her majority opinion.
The justices overturned appeals court rulings that judges cannot hand down lesser punishments than described in sentencing guidelines. In a related ruling, the court also supported the right of judges to depart from sentencing guidelines in a case involving distribution of the drug Ecstasy.
The sentencing issue has a strong racial component. Kimbrough, a veteran of the first Gulf War, is black, as are more than 80 percent of federal defendants sentenced in crack cases. By contrast, just over a quarter of those convicted of powder cocaine crimes last year were black, according to the Associated Press.
The sentencing disparity dates back to a 1986 anti-drug law that was adopted out of concern over a crack cocaine and crime epidemic then sweeping many U.S. cities.
The law gives first-time offenders convicted of selling five grams of crack cocaine the same five-year mandatory prison sentence as dealers of 500 grams of powder cocaine. The sentencing guidelines incorporated the 100-to-1 ratio.
Critics have called the disparity unfair and racially biased, leading to claims of inconsistency in the nation's judicial system.
The Sentencing Commission lowered crack-cocaine sentencing guidelines on Nov. 1 -- a first-time offender with five grams or more now faces 51 to 63 months in prison, down from the 63 to 78 months.
The Kimbrough decision was announced ahead of a commission vote scheduled for Tuesday that could rewrite guidelines to cut prison time for up to an estimated 19,500 federal inmates convicted of crack crimes.
The Sentencing Commission recently changed the guidelines to reduce the disparity in prison time for the two crimes. Tuesday's vote is whether to apply the guidelines retroactively.
In another 7-2 vote in the Ecstasy case, the court again upheld a judge's decision to hand down a lighter sentence. Brian Gall was convicted in Iowa of conspiracy to sell Ecstasy. He was given probation, instead of the 30 to 37 months in prison called for under the sentencing guidelines.
Chief Justice John Roberts and Justices Stephen Breyer, Anthony Kennedy, Antonin Scalia, David Souter, Ginsburg and John Paul Stevens formed the majority in both cases.