SACRAMENTO, Calif. (AP) — California will become the first state to pay for some adults living in the country illegally to have full health benefits as the solidly liberal bastion continues to distance itself from President Donald Trump’s administration.

Democrats in the state Legislature reached an agreement Sunday afternoon as part of a broader plan to spend $213 billion of state and federal tax money over the next year. The legislature is expected to approve the deal this week. The agreement means low-income adults between the ages of 19 and 25 living in California illegally would be eligible for California’s Medicaid program, the joint state and federal health insurance program for the poor and disabled.

Not everyone in that age group would get the health benefits, but only those whose incomes are low enough to qualify for the program. State officials estimate that will be about 90,000 people at a cost of $98 million per year.

The move is part of a larger effort to make sure everyone in California has health insurance. The proposal also makes California the first state in the country to help middle income families pay their monthly health insurance premiums. It means a family of four earning as much as six times the federal poverty level — or more than $150,000 a year — would be eligible to get about $100 a month from the government to help pay their monthly health insurance premiums.

But to pay for part of it, the state will begin taxing people who don’t have health insurance. It’s a revival of the individual mandate penalty that had been law nationwide under former President Barack Obama’s health care law until Republicans in Congress eliminated it as part of the 2017 overhaul to the tax code.

The budget agreement still must be approved by the full state Legislature. State law requires lawmakers to enact a budget by midnight on June 15. If they don’t, lawmakers would lose their pay.

The health care proposals are a win for first-term Democratic Gov. Gavin Newsom, who proposed both of them. Several lawmakers in the Democratic-dominated state legislature wanted to go further by offering health coverage to all adults living in California illegally. But Newsom opposed that, noting it would cost $3.4 billion.

Newsom did not get everything he wanted in the deal. Advocates say more than 1 million people in California don’t have access to safe drinking water. Newsom had proposed a 95-cent tax on most residential water bills as well as fees on dairies, animal farms and fertilizer sellers, to help water districts pay for improvements and boost supplies. Lawmakers rejected the tax, arguing it was too burdensome in a year when the state is projected to have a $21.5 billion surplus — the largest in at least 20 years.

Instead, lawmakers decided to use $130 million in existing tax revenue to pay for the drinking water improvements. Most of that money — about $100 million — would come from the state’s sale of carbon credits as part of its “cap and trade” program. The move means the state’s agricultural industry, whose pollution is often blamed for the drinking water problems, would have ab out $100 million less than it normally gets from the program for various projects.

Newsom also wanted to expand spend $800 million to boost the annual tax refunds for low-income people who have at least one child under the age of 6. But to pay for it, he wanted to selectively adopt some of the changes to the federal tax code that Trump signed into law in 2017. The changes, which would mostly impact businesses, would have brought the state an extra $1 billion.

But the legislature did not include the tax changes in its version of the budget proposal. Instead, lawmakers said they hope to reach a tax agreement outside of the budget process by July 1.