A lawsuit filed by a California company threatened to make Britney Spears' medical history public, but a judge has thwarted its efforts.

According to E! Online, a brand development group called Brand Sense requested the medical information in order to build evidence for a lawsuit it has filed against the pop singer over a perfume deal. However, a Los Angeles Superior Court judge denied the request and said that the records are protected by privacy statutes.

Brand Sense sued Spears in March for $10 million, claiming it was cut out of 35 percent of the royalties from the singer's Elizabeth Arden fragrance deal. The company was seeking to depose the 29-year-old, but another judge deemed she was not competent to testify on her own behalf, due to the conservatorship run by her father Jamie Spears and her legal team, who have control over her finances and business affairs.

Brand Sense's lawyers were seeking to prove the singer is competent, but Spears' team successfully argued against the petition, saying that the company's motives had nothing to do with the singer's well-being, and the request was simply out of its "selfish" interest in obtaining her deposition. Brand Sense has not yet filed an appeal.