NEW YORK (AP) — The nation’s health department starting Monday can resume sharing the personal data of certain Medicaid enrollees with deportation officials, according to a federal judge’s ruling, in a blow to states that had sued the administration over privacy concerns.

However, the judge’s decision, issued last Monday, strictly limits the scope of data from the 22 plaintiff states that can be shared — currently allowing the agency to hand over basic biographical information about immigrants residing in the United States illegally. The states’ lawsuit came after an Associated Press report identified the data sharing policy.

The ruling from U.S. District Judge Vince Chhabria in San Francisco follows the Centers for Medicare and Medicaid Services' announcement of its plans to resume data sharing as part of the Trump administration’s stringent immigration enforcement efforts.

Initially, in August, Judge Chhabria had blocked the U.S. Department of Health and Human Services from sharing personal data, such as home addresses, with Immigration and Customs Enforcement (ICE). He extended that order in December.

Chhabria ruled that after the temporary order expires on Jan. 5, HHS can resume sharing basic biographical, location and contact information about immigrants living in the U.S. illegally with ICE. He noted that this sharing is clearly authorized by law and the agencies have adequately explained their decisions.

While the ongoing lawsuit proceeds, HHS and CMS cannot share detailed sensitive medical information about enrollees with the Department of Homeland Security or ICE, according to Chhabria's ruling. They are also prohibited from sharing Medicaid data concerning U.S. citizens or legal immigrants from the 22 plaintiff states.

The judge expressed concerns regarding the opaque federal policies on what information would be shared, the necessity for immigration enforcement, and potential risks associated with disclosing such information to DHS.

Whether HHS had resumed sharing Medicaid data on recipients living in the U.S. illegally remained unclear, as a spokesperson did not comment immediately.

Under current federal law, immigrants living unlawfully, along with some lawful residents, are not eligible for regular Medicaid, though they can access emergency Medicaid, which covers life-saving services.

In June, HHS began sharing personal data on millions of Medicaid enrollees in specific states. In July, CMS signed a new agreement, allowing DHS daily access to view extensive personal data, including Social Security numbers and addresses of the country’s 77 million Medicaid enrollees, without public acknowledgment.

This problematic sharing of health data with deportation officials emerged amid the administration's robust immigration enforcement strategy, prompting the lawsuit addressing privacy concerns.

Advocates for immigrants have indicated that the personal information shared could intimidate individuals seeking emergency medical assistance for themselves or their children. Recent immigration crackdowns have made public spaces, including schools and hospitals, feel perilous for undocumented immigrants and even U.S. citizens fearing deportation.

CMS conveyed in November that its intention to supply the data to ICE aligns with federal law and aims to advance immigration-related priorities. This data sharing is coupled with the administration’s broader immigration crackdown encompassing federal agencies, extending even into Democratic-led cities.

The administration has made various attempts to facilitate data sharing with immigration officials, including a ruling in May, where a federal judge did not prevent the IRS from sharing immigrant tax data with ICE, which could aid agents in locating and detaining individuals living in the U.S. unlawfully.