After two years of bitter legal wrangling, Highmark and UPMC have signed a 10-year contract ending their longstanding battle and guaranteeing that Highmark customers will have access to UPMC doctors and facilities.

The contract will go into effect July 1, immediately after the expiration of the current consent decrees — meaning patients shouldn’t experience any disruption in their care.

Prior to this new agreement, 11 UPMC hospitals and the doctors affiliated with them were due to become out-of-network for Highmark members after June 30.

“This is a global deal” giving every Highmark customer access to UPMC doctors and facilities, Attorney General Josh Shapiro said at a press conference in Pittsburgh today. “It guarantees them access, and it guarantees it for a long time.”

Each side didn’t get everything they wanted, Shapiro said: “This is a deal that is fair to both sides. Most importantly, it’s fair to the consumers.”

“I’m proud to announce this historic settlement today that restores fairness and access to affordable care for the people of Western Pennsylvania and reinjects real choice into the healthcare marketplace,” said Shapiro. “Without this agreement, millions of patients — including seniors, cancer patients and working mothers — would have had their health care abruptly upended. Thanks to the patients who told their stories about what they stood to lose, Western Pennsylvanians now have their access to a fair healthcare system secured for the next decade.”

This decade-long agreement is the longest that UPMC has ever made with an insurer.

Though the deal was brokered between UPMC and Highmark, at today’s press conference Gov. Wolf credited Shapiro with pushing hard to make it happen. The related lawsuits that Shapiro had been pursuing, which focused on issues with the current consent decrees, will be withdrawn now that the new agreement is in place.

But while that legal battle is over, Shapiro said, “that doesn’t mean our oversight responsibilities will be withdrawn.”

“As Attorney General, I swore an oath of office to protect the rights of all Pennsylvanians,” Shapiro said. “That means putting people before powerful institutions, and holding powerful institutions accountable to the people they serve.”

This decisive resolution to the two-year legal battle between the healthcare giants and the state is a “big deal for all of us in Pennsylvania,” Wolf said, “especially a big deal for the folks living in Western Pennsylvania.”