An internal investigation into how the federal government awarded contracts for developing and building the Affordable Care Act’s most important public element — the online exchanges that were to be used by millions of Americans to purchase health insurance — has found the process was flawed.

The investigation showed that The Department of Health and Human Services failed to conduct background checks on prior work by companies awarded many of the Obamacare contracts and failed to require those same companies to be accountable for cost overruns, leaving taxpayers on the hook instead.

The report published Thursday by the Office of the Inspector General for HHS concludes those mistakes cost taxpayers more than $400 million in unexpected costs — essentially doubling the expected cost of building the exchanges in the first place.

For a project of this size and importance, CMS [Centers for Medicare and Medicaid Services] missed opportunities to leverage all available acquisition planning tools and contracting approaches to identify and mitigate risks,” the inspector general wrote in the report.

The federal Obamacare exchange went live in October 2013, and was immediately beset with technical problems that severely limited its functionality. After several months of work, the Obama administration declared the problems fixed in early 2014, though technical difficulties have continued to plague it and several of the state-based exchanges also set up as part of the Affordable Care Act.

The inspector general examined 60 contracts signed by CMS for the online health insurance site and conducted interviews with “high level” staff at CMS and HHS about the contracting process.

In two of those contracts — including the $93 million contract signed with CGI Federal, the firm responsible for several major elements of the Obamacare federal exchange — CMS did not conduct a part performance review of their work.

“It is imperative that CMS conduct comprehensive reviews of companies’ past performance to ensure that it contracts with reliable companies,” the inspector general concluded.

Had they done so, CMS may have discovered CGI Federal had essentially been fired by the provincial government in Ontario, Canada, after “the firm missed three years of deadlines and failed to deliver the province’s flagship online medical registry,” as the Washington Examiner reported in 2013.

And had they known about that history, CMS might have done a better job of writing the contract to ensure contractors like CGI Federal would pay for cost overruns.

Instead, five of six “key contracts” handed out by the department were written on a so-called “cost reimbursement” basis, meaning the government — ultimately, taxpayers — would cover any unexpected expenses.

“CMS’s choice of contract type for certain key contracts resulted in the government shouldering the risk for cost increases,” the inspector general concluded.

Those six contracts were initially supposed to cost $464 million. By early 2014, when the inspector general began his review, the cost had ballooned to more than $820 million.

The contract with CGI Federal tripled during that period, from $58 million to $207 million, the inspector general reported.

Only two of those six “key contracts” were reviewed by CMS’ Contract Review Board before they were awarded.

“Although the Federal Marketplace was an unprecedented project with unique challenges, the experience of contracting for the Federal Marketplace has broader implications for Federal contracting,” the inspector general wrote. “The issues raised in this report demonstrate the need for HHS and CMS to make changes to strengthen their contracting processes.”

Ellen Murray, assistant secretary for financial resources for CMS, wrote that both HHS and CMS were working to implement changes based on the inspector general’s findings.

“CMS is enforcing a strict governance structure for contracts and is training a strong acquisition workforce,” Murray wrote. “These efforts are yielding positive results.”