Starbucks says the ruling validates its tip policy
Starbucks has been told it does not have to repay millions of dollars to junior staff who had to share their tips with supervisors.
Last year, the coffee giant had been ordered to repay $100m (£60.4m) to more than 100,000 coffee-makers, or "baristas", in California.
But an appeals court reversed that ruling, saying supervisors and baristas "essentially performed the same job".
Lawyers for the baristas said they planned to appeal against the decision.
David Lowe, the lawyer representing the baristas, said: "Up to this point, every court that has addressed this issue has found that an employer cannot pay supervisors from a tip pool. This is the first case that goes in a different direction."
Starbucks said it was pleased with the ruling, which "validates our longstanding tip policy".
The initial lawsuit was filed in October 2004 by Jou Chou, a former Starbucks barista in La Jolla, California.
She accused Starbucks of improper tipping practice by letting shift supervisors share in tips with the part-time, hourly baristas.
Her lawyers argued that the firm was using tips to subsidise labour costs for the supervisors instead of paying them a higher wage.
In 2006 the lawsuit was granted class action status, allowing it to go forward on behalf of about 120,000 former and current baristas in the chain's California stores.
In March 2008, San Diego Superior Court Judge Patricia Cowett ruled in favour of the baristas, saying that Starbucks' policy of tip-pooling violated California's Unfair Competition Law, which bars managers and supervisors from obtaining a share of employee tips.
Starbucks contested the ruling, arguing that shift supervisors spent as much as 95% of their time performing the same duties as baristas, including taking orders and making coffee.
It also argued that shift supervisors did not have the power to hire, fire or discipline baristas.
And the appeals court has now agreed. It reversed the ruling and ordered the trial judge to "enter judgement in Starbucks' favour".
The court noted that Starbucks shift supervisors "are also part-time, hourly employees who perform all the duties of a barista, but are also responsible for some additional tasks".
It went on: "There is no [legal] authority prohibiting an employer from allowing a service employee to keep a portion of the collective tip, in proportion to the amount of hours worked, merely because the employee also has limited supervisory duties."