In the largest sexual discrimination lawsuit ever, the Supreme Court sided with retail king Wal-Mart (WMT) on Monday, overturning a ruling that granted class-action status to female employees that had sought billions of dollars.

The unanimous decision, which was written by Justice Antonin Scalia, concerned the ability of 1.5 million female Wal-Mart employees to team up to sue the worlds largest retailer for gender discrimination.

The employees had alleged Wal-Mart, which is the largest U.S. private employer, has a corporate culture that favors the advancement of male workers over their female counterparts.

While Wal-Mart pressed its belief that class action claims are unwieldy and unfair, lawyers for the women argued class action suits were the only mechanism to fix systematic bias that result in big salary disparities.

The plaintiffs had been seeking injunctive and declarative relief as well as an award of backpay.

Shares of the Bentonville, Ark.-based company hit session highs on the decision, recently trading up 0.62% to $53.15.

"Walmart has had strong policies against discrimination for many years," Gisel Ruiz, an executive vice president at Wal-Mart, said in a statement. "The Court today unanimously rejected class certification and, as the majority made clear, the plaintiffs' claims were worlds away from showing a companywide discriminatory pay and promotion policy."

Oral arguments on the case, which were held in March, signaled Wal-Mart may prevail as even Justice Ruth Bader Ginsburg, a defender of womens rights, expressed skepticism.

The lawsuit began more than 10 years ago when Betty Dukes, a Wal-Mart worker, said her bosses at a Pittsburg, Calif., store passed her over for promotions.

The case folded into a class action lawsuit and two lower courts ruled the case could go to trial. The Supreme Courts decision Monday overrules those lower decisions.

"By reversing the Ninth Circuit Court of Appeals decision, the majority effectively ends this class action lawsuit," Ruiz said. 

However, the lawyers behind the class action lawsuit said they believe the ruling still allows women whose complaints go back to December 26, 1998 to file charges with the U.S. Equal Employment Opportunity Commission or bring their claims in court.

Nothing the Supreme Court has ruled affects the power of the evidence of sex discrimination at Wal-Mart, the plaintiffs said in a statement. That evidence is as strong today as it was when it was collected.

Speaking for the majority, Scalia said that the certification of the class was not consistent with a federal rule and backpay claims were improperly certified.

Scalia wrote that the respondents statistical proof of discrimination fails and their anecdotal evidence is too weak to raise any inference that all the individual, discretionary personnel decisions are discriminatory.

The majority also believed the members of the class had little in common other than their sex and this lawsuit. Because the respondents provide no convincing proof of a company-wide discriminatory pay or promotion policy, they failed to establish the existence of any common questions required in these class action lawsuits, Scalia wrote.

Follow Matt Egan on Twitter @MattMEgan5