The funds come from both the federal and state governments and ease the rules on how to run the Medicaid program, known as Medi-Cal in California.

The state Department of Health Care Services submitted a proposal for the waiver, also known as “Medi-Cal 2020,” in March and had been negotiating with the federal Centers for Medicare & Medicaid Services ever since. The original proposal was whittled down from $17 billion to $7.25 and finally to $6.2 billion during the negotiations.

Even so, Dr. Susan Ehrlich, CEO of San Mateo Medical Center, said Saturday that public hospitals can now keep improving access to primary care, integrating physical and mental health services and making other changes to help patients stay healthy and out of the hospital.

Ehrlich, who traveled to Washington earlier this week with several other hospital leaders to push for the new waiver, said she and others will be watching closely to see how the details get worked out.

“But mostly, we are just really pleased that the overarching substance of the deal turned out the way it did,” she said.

Under the expiring five-year waiver, known as the “Bridge to Reform,” hospitals across the state began to overhaul the way they provided care. For example, they created programs to track chronically ill patients and expanded their primary care clinics. Other programs helped reduce deaths by sepsis infections and the number of patients with uncontrolled diabetes.

Hospital leaders said they expect the changes to save money for the state and federal government.

With the new waiver, health officials can take their efforts to the next level, Anthony Wright, executive director of Health Access California, said in a statement. Once the details are hammered out, Wright said, “we expect to see an explosion of exciting activity at the county level to improve health care.”

Wright added that the agreement has the potential to “spur innovation in counties across the state.”

The waiver also fundamentally changes the way government covers the uninsured. Instead of only covering hospital-based care, public hospitals and clinics will have more flexibility and be able to focus more on outpatient and primary care.

Instead of funding five years of care for the uninsured, however, the plan only specifies $236 million for the first year. Funding for the next four will depend on an outside assessment of how much hospitals need.

The Affordable Care Act expanded coverage to millions of Californians. Still, more than 3 million are believed to be without insurance. Murray of the hospital association said she believes there will still be “significant need” for hospitals to receive additional funding for the uninsured population.