Ms Sotomayor sits on the Second Circuit Court of Appeals
The US Supreme Court has overturned a ruling endorsed by Sonia Sotomayor, President Barack Obama's nominee to fill a vacancy on the court.
Ms Sotomayor, an appeals court judge, had ruled that white firefighters in Connecticut had not been unfairly denied promotions.
But the Supreme Court ruled by five votes to four that the firefighters had been unfairly discriminated against.
The ruling could have a significant impact on US employment practices.
The firefighters, from New Haven Connecticut, had taken a promotion exam, but city authorities threw out the results after no African-Americans and only two Hispanic firefighters did well enough to win promotion.
New Haven officials feared that if they honoured the results of the test, they could have been sued under racial equality legislation.
But some of the city's white firefighters brought a lawsuit against the authorities to reinstate the results of the exam.
When Ms Sotomayor and her colleagues on the Second US Circuit Court of Appeals heard the case, they ruled that the city had acted correctly, but the US Supreme Court has now overturned that decision.
"Fear of litigation alone cannot justify an employer's reliance on race to the detriment of individuals who passed the examinations and qualified for promotions," said Justice Anthony Kennedy in his majority opinion for the court, backed by four other justices.
In a dissenting opinion, Justice Ruth Bader Ginsburg said the white firefighters "understandably attract this court's sympathy. But they had no vested right to promotion."
Justice David Souter, whom Ms Sotomayor is nominated to replace on the court, agreed with Justice Bader Ginsburg's opinion.
The BBC's Kevin Connolly in Washington says the ruling is an embarrassment for Judge Sotomayor, but her eventual confirmation on Capitol Hill still seems assured by the large Democratic majorities there who support Barack Obama.