SACRAMENTO, Calif.—California lawmakers are headed for a showdown over how many illegal immigrants should qualify for government-subsidized health care.

Democratic Gov. Gavin Newsom has proposed allowing unauthorized immigrants under 26 to enroll in Medi-Cal, the state’s Medicaid program. Some members of the legislature, which is dominated by Democrats, have proposed that low-income people of all ages be eligible, regardless of their immigration status.

Both would be first-in-the-nation expansions and represent another step by California to enact economic and social policies in defiance of the Trump administration, including support for those in the country illegally.

The rare point of disagreement between the governor and members of his party comes as the state is flush with tax revenue from a booming economy. But Mr. Newsom has said expanding Medi-Cal to all adults over 25, who typically have higher health care costs than the young, could be financially unsustainable, particularly if the economy slows and state revenue declines.

There are “3.4 billion reasons why it’s a challenge,” he said at a recent press conference, referring to the estimated annual dollar cost for covering all unauthorized immigrants in California.