A former Prince William County employee was sentenced Thursday to serve two years in prison for his role in a scheme that set up shell companies to bid on and win county technology contracts.

John Roessler, 53, worked in the county’s Office of Information Technology until 2008. Between 2004 and 2008, he and the IT department’s division chief, Maneesh Gupta, created shell companies to compete and win IT contracts that totalled around $8 million.

Roessler carried out work for a shell company called Praetorian Systems and had pleaded guilty to dozens of charges including racketeering and rigging bids. Aside from his prison sentence, Roessler faces 10 years of probation and will have to begin paying back $3.7 million prosecutors say he, Gupta and others involved owe the county. Judge Craig D. Johnston said an exact restitution plan would be set up at a later time.

Roessler said in court that he wanted to “express my sincerest apology” before being sentenced by Johnston. “I look forward to the opportunity to try to make this right,” Roessler said.

An investigation found that with Gupta largely responsible for signing off on county IT contracts, Praetorian was given bids nearly 90 percent of the time.

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 have 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.

Gupta, 48, has pleaded guilty and was sentenced to three years in prison and 10 years probation. He almost must pay back $3.7 million to Prince William.

Roessler’s brother, Vernon A. Roessler, 44, also helped with the scheme. He has pleaded guilty and will be sentenced Feb. 10.

Richard Billingsley, 44, acted as the head of Praetorian Systems. But prosecutors say he was less involved than others in the scheme, and was sentenced to serve three months in jail earlier this month for money laundering, among other charges.