PITTSBURGH (KDKA/AP) —   Had Attorney General Josh Shapiro wanted to shout it from the top of Mt Washington who would have blamed him: “UPMC and Highmark have agreed to enter into a 10 year agreement.”

With that, a lot of anxiety has been drained out of Western Pennsylvania.

“When you’re sick every day matters,” Shapiro continued.

“Today millions of Pennsylvanians and their families can rest easier knowing they don’t have to worry about their care changing after June 30.”

Pennsylvania’s governor and attorney general Josh Shapiro made a major announcement Monday that UPMC and Highmark have agreed to enter a 10-year contract that will extend access to UPMC facilities for Highmark-insured patients.

After the Commonwealth Court arguments, and while the two sides were waiting to see if UPMC would be forced into continuing a relationship with Highmark which it viewed as a competitor, Shapiro says, “UPMC reached out to pick up on discussions for a remedy for the people of Western Pennsylvania.”

The announcement comes less than a week before a deadline that would cut off Highmark customers’ access to many UPMC facilities.

The previous five-year consent decree between the two health care providers was set to expire on June 30, which would have put hundreds of thousands of Highmark subscribers in jeopardy of losing access to UPMC facilities.

The new contract will go into effect on July 1, meaning patients will not face any disruption in their care, says Shapiro.

Shapiro says there will also be a new foundation for going forward, and that the two health care giants will no longer be adversaries. Rather, they will act together to serve the public.

“Patients who felt in limbo, families looking to transfer lifelong primary care providers, and these two health care institutions will now return to regular order,” Shapiro says.

WATCH: KDKA’s John Shumway report live

Also, he said, unlike the former consent decree, this is an agreement between the two parties without government intervention.

“As a result of these discussions, patients are no longer caught in the middle, and the power is returned to the consumers,” Shapiro said.

“That’s why my office took action to protect the millions of Pennsylvanians who rely on UPMC for their health care and for their wellbeing.”

“I could not be more grateful to these two companies; they were able to put aside their differences, even in the final hours of the existing consent decree and focus on a cause bigger than them.”

RELATED STORIES:

Shapiro, who earlier this month lost a court decision in his effort to extend the companies’ relationship, called the agreement a good deal for patients and the public.

UPMC had opposed renewing their agreement in 2012 after Highmark purchased what’s now Allegheny Health Network and became what UPMC viewed as a competitor in providing health services and insurance coverage. That led to a five-year consent decree that expires Sunday.

Highmark Health President and CEO released a statement Monday afternoon about the contract. It reads, in part:

“Today’s news about a contract between Highmark and UPMC fulfills the promise to our community that we at Highmark Health have strived to achieve for the last five years: Consumers and patients have two outstanding health systems, in addition to our many independent community hospitals, to choose from for their care.

“This announcement brings the certainty of health care access to thousands of people in our community. It marks a significant step forward for our region.

“On behalf of our employees, clinicians and all of those we serve, I’d like to thank Pennsylvania Attorney General Josh Shapiro for his leadership and advocacy in helping to broker this new day for health care in Western Pennsylvania.”

In a press release posted to their website, UPMC said, in part:

“UPMC believes in the importance of informed consumer choice and has always sought to ensure that when UPMC is part of any insurance network, those members have full access to UPMC without contractual terms used to discourage or limit the use of UPMC’s physicians and facilities. This important consumer issue was resolved in a collaborative fashion and UPMC’s network will now be available to Highmark members. UPMC appreciates that we were able to reach this agreement with Highmark on a long-term, in-network contract.

“UPMC is grateful for the Attorney General’s leadership as the agreement announced today was built on a foundation of trust, compromise and collaboration. As always, UPMC remains committed to exceptionally serving the health care needs of the citizens of Pennsylvania.”

Mayor Bill Peduto has released this statement on the announcement:

“This is great day for health care in Western Pennsylvania. We have been in discussions with Highmark and UPMC for five years, and it has long been critical for those talks to be continuous, constructive and respectful. We will continue to mediate in that manner whenever necessary. This agreement allows us to enter a new chapter, and create a potential for new partnerships, where we can work together to create a global center of medicine that will be unparalleled in a region our size.”

The agreement has already been approved by the UPMC and Highmark boards, but it needs a nod from the Pennsylvania Department of Insurance.

After that, it will go into effect when the consent decree expires at midnight Sunday.

The Attorney General’s lawsuit against UPMC is being withdrawn.

The bottom line: Highmark insured patients won’t have to change doctors or hospitals.

(TM and © Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)