More than 21,000 undocumented people in Colorado could lose Medicaid coverage under the just-passed Republican bill that extends 2017 tax cuts, trims social safety-net programs and boosts spending on immigration enforcement.

H.R. 1, the legislation formerly known as the One Big Beautiful Bill Act, has a provision that would penalize states such as Colorado that use their own funds to cover undocumented people. Colorado covers any undocumented children who sign up for Medicaid but restricts coverage for adults to pregnant and postpartum women.

The House of Representatives passed the Senate’s version of the bill Thursday, sending it to President Donald Trump, who has made it a core pillar of his second-term agenda.

The bill reduces the federal government’s share of the costs for what’s known as the expansion population — adult citizens who earn up to 138% of the poverty line and don’t qualify for Medicaid because of pregnancy or a disability — from 90% to 80%, forcing states to either come up with millions to cover that population or to stop insuring undocumented people.

Colorado could lose about $300 million in federal funding annually if the federal government reduced its share, Gov. Jared Polis said.

The state faces a $700 million budget hole next year and recently announced it would lay off 11 people in the health department if it couldn’t regain a $1.9 million federal grant — meaning it would be fiscally almost impossible to accept a loss of hundreds of millions, even if lawmakers want to continue covering undocumented people.

The Congressional Budget Office estimated about 11.8 million people would lose coverage and the federal government would spend about $1.1 trillion less on health insurance programs if the bill passed in its current form, with the vast majority of cuts coming from Medicaid. At the same time, the bill is projected to increase the deficit by about $3.3 trillion because of tax cuts and increased spending on other priorities.

The Colorado Department of Health Care Policy and Financing reported 21,261 undocumented people had Medicaid coverage as of June 22.

More than three-quarters were children, with the rest qualifying because they were pregnant or in the postpartum period. A department spokesman said they will release the cost of insuring the group in July or August, after compiling numbers from the fiscal year that ended June 30.

The bill in Congress also narrows the group of immigrants with legal status who can receive tax credits to purchase health insurance on the federal marketplace.

Federal law prohibits low-income immigrants from enrolling in Medicaid if they’ve lived in the country for less than five years but has allowed them to qualify for subsidies to buy insurance.

Only permanent residents (those with so-called green cards), certain Cuban and Haitian immigrants, and people from countries in the Compact of Free Association, such as Palau and the Marshall Islands, would qualify.

The Trump administration also announced June 20 that it would no longer allow undocumented people who entered the country as children, or “Dreamers,” to purchase coverage on the marketplace.

Connect for Health Colorado estimated that about 6,000 people in the state would likely lose marketplace coverage if the bill passed. They wouldn’t qualify for any programs offering insurance but could receive some help through a state law requiring hospitals to offer discounted care to people with low incomes, or through limited programs covering services such as family planning, a spokeswoman said.

Three of Colorado’s four Republican members of Congress — Rep. Gabe Evans, Rep. Lauren Boebert and Rep. Jeff Crank — signed a letter to Polis urging the state to end its coverage of undocumented people. Rep. Jeff Hurd, a Republican who represents much of western and southern Colorado, was the exception.

In the letter, they said that covering undocumented people would take benefits from “those who need it most,” especially if the bill in Congress reduces federal payments to the state.

“We stand united in the common cause of protecting Medicaid for generations to come by ensuring only lawful beneficiaries can access this critical program,” the letter said.