New York City will be paid more than $500 million by computer contractor SAIC in a fraud case related to the company's work for the city, officials said on Wednesday.

A unit of SAIC Inc has agreed to pay $500.4 million to resolve its part of a federal criminal probe into fraud at CityTime, a New York City payroll system, said Preet Bharara, the U.S. Attorney for the Southern District of New York.

This resolution is - as far as our office is aware - the largest in history for any city or state fraud, Preet Bharara said at a news conference with Mayor Michael Bloomberg. The city will be made whole, Bharara added.

SAIC was hired as the primary contractor in 2000 to automate time keeping for city employees. Critics say Bloomberg could have had the work done in-house. Costs spiraled out of control over the years, and city investigators brought federal prosecutors into the probe after uncovering payments routed through shell companies.

If you attempt to defraud the public, you will be found and you will regret it and you will face justice, said Bloomberg.

Science Applications International Corp agreed to pay $370.4 million in restitution to the city, as well as a penalty of $130 million, according to a deferred prosecution agreement made public on Wednesday. It also consented to the filing of a charge accusing it of conspiring to commit wire fraud.

Federal prosecutors have also seized or placed liens on $52 million of assets from eight criminal defendants. The company placed profit ahead of principle time and time again ... that is why we insisted that the company pay from its own pocket every penny, said Bharara. SAIC agreed to continue to cooperate in the probe until three years after the signing of Wednesday's agreement or the end of the legal process, including any prosecutions or appeals. The company's legal challenges are not yet over as the prosecutors can still probe SAIC for criminal tax violations.

(Editing by Jan Paschal and James Dalgleish)