A major insurer run by New York state’s largest medical provider is pulling out of ObamaCare because of massive losses, the company announced Thursday.

Northwell Health (the former North Shore-Long Island Jewish Medical Center network ) blamed a flawed provision in the Affordable Care Act — and the lack of action in Washington to fix it — as the culprits for winding down its CareConnect insurance company.

CareConnect enrolled 14 percent of firms in New York’s small group market and 8 percent of customers in the individual ObamaCare market — mostly on Long Island and in New York City.

The firm said it had to pay $112 million last year into a risk insurance pool created to prop up insurers that had a disproportionate number of high-risk or money-losing clients.

The pool was designed to prevent insurers from “cherry-picking” younger and healthier customers who are less expensive to cover.

But the high payments were bankrupting CareConnect — formed in 2013 — and becoming a financial drain on its parent company, Northwell.

The company is New York state’s largest health care provider, with 22 hospitals and 550 outpatient facilities.

The payments to the risk adjustment pool accounted for 44 percent of CareConnect’s revenue in 2016.

It would have to make another risk adjustment payment of $100 million next year.

“It has become increasingly clear that continuing the CareConnect health plan is financially unsustainable, given the failure of the federal government and Congress to correct regulatory flaws that have destabilized insurance markets and their refusal to honor promises of additional funding,” said Northwell CEO Michael Dowling.

Dowling, who was a top health adviser to former Gov. Mario Cuomo, the father of current Gov. Andrew Cuomo, thanked state officials for trying to reduce the financial impact of the losses over the past year as the insurer awaited a federal fix.

“However,” Dowling added, “the continuing uncertainty in Washington about the future of the ACA, intractable regulatory problems and the federal government’s broken promise of so-called ‘risk corridor’ payments to insurers provide us with no viable path to profitability in the foreseeable future.”

Northwell will be submitting its withdrawal plan to the state Department of Financial Services and will continue operations over the next year to give customers time to transfer to other plans.

Financial Services Superintendent Maria Vullo, in a statement, said Northwell’s decision to close CareConnect was “unfortunate” — but wouldn’t contest it.

“We recognize that this decision will help Northwell focus on its core mission to deliver health care services to New Yorkers,” Vullo said.

She insisted that New York’s health insurance remains “robust” and New Yorkers still have choices for coverage.

The last ObamaCare insurer to go under in New York was Health Republic in 2015.

The state recently announced that health insurances rates will go up an average of 14 percent for customers in the individual market and over 9 percent in the small group market — the second consecutive year of hefty increases.