MemorialCare Health System and Anthem Blue Cross have reached a multiyear contract agreement, officials announced Friday afternoon, ending a stalemate that affected thousands of Long Beach area patients.

Talks between the insurance provider and hospital system, which operates Long Beach Memorial Medical Center, Miller Children’s Hospital, Community Hospital, Orange Coast Memorial Medical Center and Saddleback Memorial Medical Center, broke down on Aug. 15, leaving patients in the lurch with little notice. Many Anthem customers began receiving letters about the news earlier this week.

A statement released Friday from Brian Ternan, president of Anthem Blue Cross, reported that the company reached a three-year agreement.

“We’re sorry for any inconvenience the termination of our previous contract may have caused our members, but today’s agreement will help ensure stability going forward,” Ternan wrote. “It’s important to our members that we achieve the appropriate balance between access and affordability, and we’ve done that with this new agreement.”

Lori Weaver, executive director of managed care for MemorialCare, said Friday that the contract — retroactive to Aug. 15 — will allow patients to receive “uninterrupted, exceptional care.”

“We’re reassured that Anthem continues to recognize that MemorialCare is a vital medical resource to the community,” she said in a written statement.

Long Beach city employees — who only have one insurer to choose from, Anthem — had found out that their insurance would no longer cover in-network costs for medical services at MemorialCare facilities late on Aug. 18. Approximately 5,000 city employees are enrolled in the Anthem health care network, along with many more who are enrolled in HMO or PPO plans with other companies or through the individual market.

Leaders of Long Beach employee unions were livid at the news earlier this week, saying they had received no warning. And a local Assemblyman, Patrick O’Donnell, blasted Anthem on Wednesday, calling on the insurer to immediately reinstate the Long Beach Memorial Medical Center as a provider. On Friday, he released a statement applauding both sides for coming back to the table.

“The news of the split was shocking and unnerving, and patients deserve to be able to count on reliable and accessible health care,” O’Donnell said.

Earlier this week, Anthem blamed MemorialCare for the breakdown, saying it was disappointed that MemorialCare chose to terminate its contract “to demand an excessive increase in reimbursement rates,” according to a statement from Colin Manning, spokesman for Anthem.

The hospital system, meanwhile, had said it had made a “modest, fair and reasonable” offer in the contract negotiations, which spanned several months, Weaver said in a statement Wednesday.

Details of the negotiations were not released. Hospitals and health systems negotiate with all insurance carriers to determine how much the carriers will pay for specific services.

The news Friday means patients with physicians at any of the five affected hospitals can resume medical services immediately without fear of paying higher, out-of-network costs.

MemorialCare said any patients with questions could call its Patient Financial Services Concierge at 714-377-6897.