Ellen Pao was socked for $276,000 in legal costs incurred by Kleiner Perkins, the venture capital firm she unsuccessfully sued for sex discrimination, according to a judge's ruling in the case.

Pao, who is now the interim CEO of Reddit, had waged a three-year legal battle in which she charged the Silicon Valley venture capital firm with sex discrimination for not promoting her and eventually firing her. She was seeking up to $16 million in lost wages, and the jury could have awarded as much as $100 million if it found Kleiner Perkins had acted with malice.

But in March a jury decided in Kleiner Perkins' favor. Kleiner Perkins then filed to have Pao pay nearly $1 million in legal costs to compensate it for expenses incurred after it had offered Pao $1 million to settle the case.

Related: The next big tech sex bias suits

San Francisco Superior Court Judge Harold Kahn scaled back much of the costs, primarily the $865,000 Kleiner Perkins paid to to hire experts in the case. But his ruling at a court hearing Thursday awarded Kleiner Perkins nearly $276,000 in legal costs.

Kahn determined that Kleiner Perkins' $1 million offer to settle the case was in good faith and not a token or nominal offer, as Pao's filings had argued, and thus the firm was entitled to recover some of its costs. But he said awarding the nearly $1 million in costs that Kleiner Perkins was seeking would be too great a financial burden on Pao, even if she has considerable economic resources of her own.

According to earlier filings in the case by Kleiner Perkins, Pao ran up her own legal expenses of $2.7 million and that she offered to drop her appeal of the jury's verdict if Kleiner Perkins compensated her for those costs. Kleiner Perkins has refused to pay her to drop her appeal, it said.