A former Prince William County employee pleaded guilty to dozens of charges Thursday, more than two years after he and three others were indicted for pulling off one of the largest bid-rigging and embezzlement scandals in county history.

Maneesh Gupta, 47, the former information systems division chief for the county’s information technology office, pleaded guilty to 49 of the original 50 charges, which included bid-rigging, forgery and uttering. One charge was dropped, prosecutors said.

Gupta’s sentencing is scheduled for Oct. 6. and he will remain out on bond until then. Commonwealth’s Attorney Paul B. Ebert said that as part of the plea agreement, prosecutors and the defense agreed that Gupta would serve 51 years in jail, with all but three suspended, and be on probation for 10 years after his release.

Gupta will also have to pay $3.7 million in restitution, though Prince William Circuit Court Judge Richard Potter said he needs to see a restitution payment plan before accepting the plea agreement.

Gupta, along with former county employees John Roessler of Woodbridge and Richard Billingsley of Springfield and Roessler’s brother Vernon Roessler of Dale City, were indicted in June 2009 for allegedly participating in a bid-rigging scheme that lasted five years.

Police said the men were rigging the county’s contracting system in order to funnel more than $8 million in work to shell companies they created.

Gupta and John Roessler would create fake bids from other contractors so that Praetorian Systems, a company they formed, could win the contracts, Assistant Commonwealth’s Attorney William Jarvis said.

Some of the work was actually completed, but it is hard to tell whether the county got the best deal for its money because there weren’t other bids to compare to, and a lot of the work was not officially documented, prosecutors said.

The county hired Gupta in February 1998, court records show. He oversaw the majority of the contracting process, which is why his scheme went undetected for so long, prosecutors said.

“This individual was given a lot of liberty and was in charge of supervising himself,” Ebert said. “He violated the trust the county placed in him. I feel confident this won’t happen again.”

The scam was finally discovered after an IT employee came forward in February 2009 and told county officials that something just wasn’t right in the department. An investigation was immediately launched, and while Gupta initially disappeared from work, he later came forward and “cleared the air,” prosecutors said.

The other three men involved in the scam face similar charges and are set to appear in court later this year. All four are also facing a civil lawsuit brought by Prince William County.

Since the scandal, the county has implemented a series of safeguards to prevent future problems. County officials said all IT vendors and their employees are now investigated before the county enters into an agreement with them. There are also stronger internal controls in place, which limit the amount of responsibility of any employee, county officials said.

“In IT, no one person should have the ability to sign off on contracts like [Gupta] did,” Prince William County Executive Melissa S. Peacor said after the arrests.

Last June, the county also hired a new leader for the bruised department. Thomas A. McQuillan, a former IT official for New Mexico, is the new chief information officer for Prince William’s IT department.