SAN FRANCISCO – A sharply divided federal appeals court Monday exposed the world’s largest private employer to billions of dollars in legal damages when it ruled that a massive class-action suit alleging gender discrimination over pay for female workers can go to trial.

In its 6-5 ruling, the 9th Circuit U.S. Court of Appeals said Walmart Stores Inc. will have to face charges that it pays women less than men for the same jobs and that female employees get fewer promotions and must wait longer for those promotions than male counterparts.

The retailer, based in Bentonville, Ark., has fiercely fought the lawsuit since it was filed by six women in federal court in San Francisco in 2001, losing two previous rulings in the trial court and again in the appeals court in 2007.

Walmart convinced the appeals court to revisit its 2007 ruling made by a three-judge panel with a larger 11-judge panel, arguing that women who allege bias should file individual lawsuits.

Walmart, which employs 2.1 million workers in 8,000 stores worldwide, argued that the conventional rules of class-action suits should not apply because each outlet operates as an independent business.

The ruling was a “big black eye for Walmart, and it’s not going to heal anytime in the near future,” said retail consultant Burt P. Flickinger. Flickinger said the ruling could turn off women shoppers — the company’s critical base — at a time it faces increased pressure from competitors ranging from Kroger to JC Penney.