California Gov. Gavin Newsom’s first budget will include money to extend public health insurance coverage to young adult undocumented immigrants, making the state the first to take that step amid the national debate about the cost and consequences of people in the country illegally.

In a budget agreement reached over the weekend between Newsom and the Democrat-controlled legislature, undocumented immigrants up to 25 years old will have the ability to sign up for Medi-Cal, the state health insurance plan for the poor. Children brought to the United States as minors by undocumented immigrants — known as “Dreamers” — were already eligible for the program.

The expansion, which is expected to affect about 90,000 young adults, would begin Jan. 1 and is estimated to cost $98 million in its first year, a small fraction of the state’s roughly $213 billion budget. The full legislature must vote by June 15 on the budget deal, which is expected to pass easily.

The agreement marked a middle ground in the legislature’s debate, which pitted Democrat against Democrat in a state where the Republican Party has virtually vanished, over how many more undocumented immigrants to allow into the $100 billion annual health insurance program.

Leading into the negotiations, the California Senate had passed a proposal that would have extended Medi-Cal eligibility to low-income undocumented seniors over the age of 65, in addition to the young adults that the deal now includes. The majority of those young adults already are covered by Medi-Cal for emergency services.

The Assembly went a step further. In its proposal, all undocumented immigrants in the state would be eligible for Medi-Cal. The cost of that expansion was estimated to exceed $3 billion a year, which — even with a $20 billion budget surplus — Newsom and more-conservative Democrats deemed too expensive.

In a statement on the agreement, Newsom said the spending plan is “balanced, creates historic reserves and expands budget resiliency.”

“It also invests in emergency preparedness and response, provides sustainable funding for safe drinking water and includes important funding augmentations to address the cost crisis in our state,” Newsom said.

California has the nation’s largest population of undocumented immigrants, with about 2.2 million people living in the state without proper residency papers or visas.

The legislature declared California a “sanctuary state” in 2017, largely in response to the Trump administration’s aggressive policies and rhetoric toward undocumented immigrants. The law, known as the California Values Act, significantly limited the cooperation state law enforcement officials can provide to federal immigration officials.

The state also has sued the Trump administration over its use of a national emergency declaration to secure funds for the construction of a barrier along the southern border with Mexico.

But the budget agreement disappointed some advocates for immigrants, who called it a half-measure at a time when money is available to fund a broader Medi-Cal expansion.

In a statement posted on Twitter, the California Immigrant Policy Center called the funding to include young adults in the Medi-Cal expansion “a clear step forward.” But the group criticized the exclusion of undocumented seniors from the budget agreement and the failure to include another proposal that would have made more undocumented immigrants eligible for the earned income tax credit.

“The exclusion of undocumented elders from the same health care their U.S. citizen neighbors are eligible for means beloved community members will suffer and die from treatable conditions,” the group’s statement said.