Rajat Gupta’s sizeable net worth will be somewhat diminished after a judge ruled Monday that the former Goldman Sachs Group Inc. director must repay the bank more than $6 million in legal fees connected with his insider trading case.

Last October, Gupta was sentenced to two years in prison for sharing corporate secrets with former hedge fund manager Raj Rajaratnam. (A year earlier, Rajaratnam received an 11-year sentence for his part in the scheme.)

Goldman argued that under the federal Mandatory Victims Restitution Act, it was entitled to repayment of the money it paid to Sullivan & Cromwell for an internal investigation and other legal fees connected with Gupta’s case.

Judge Jed Rakoff largely agreed and awarded Goldman 90 percent of the restitution it asked for, including costs related to a Securities and Exchange Commission case against Gupta and the criminal case against Raj Rajaratnam. According to Rakoff, who oversaw Gupta’s criminal trial, Goldman’s expenses were a “necessary, direct and foreseeable result of the investigation and prosecution of Gupta’s offense of conviction.”

Rakoff did not award Goldman the full $6.91 million that it initially sought, however, because he found that some of the costs dealt with depositions in civil cases that occurred after the criminal conviction. He also said that Goldman occasionally assigned too many attorneys to the case.

Both Gupta and Rajaratnam are appealing their insider trading convictions. Goldman is still responsible for Gupta’s legal fees until his appeal is complete; as part of its bylaws, the bank must cover the legal costs of its top directors and officers. If a court upholds Gupta’s conviction, however, he will have to reimburse his former employer for these remaining fees, as part of a deal he reached before his trial, the New York Times reports.

Read more at Thomson Reuters.

For more InsideCounsel coverage of Gupta’s trial, see:

Rajat Gupta seeks to overturn his insider trading conviction

Bill Gates, Kofi Annan, others ask judge to be fair in Gupta sentencing

Gupta’s lawyer suggests others linked info on P&G

Judge unlikely to throw out wiretap evidence in Gupta case

Gupta decides not to testify

DOJ closes in on former Goldman Sachs executive