PORTLAND, Ore. — A federal judge on Saturday put on hold a Trump administration rule requiring that immigrants prove they will have health insurance or can pay for medical care before they can receive visas.

U.S. District Judge Michael Simon granted a preliminary injunction that prevents the rule from going into effect Sunday. It’s not clear when he will rule on the merits of the case.

Seven U.S. citizens and a nonprofit organization filed the federal lawsuit Wednesday contending the rule would block nearly two-thirds of all prospective immigrants coming to the U.S. legally.

The lawsuit also said the rule would greatly reduce or eliminate the number of immigrants who enter the United States with family-sponsored visas. “We’re very grateful that the court recognized the need to block the healthcare ban immediately,” said Justice Action Center senior litigator Esther Sung, who argued at Saturday’s hearing on behalf of the plaintiffs. “The ban would separate families and cut two-thirds of green-card-based immigration starting tonight, were the ban not stopped.”

The proclamation signed by President Trump in early October applies to people seeking visas from abroad — not those in the U.S. already. It does not affect lawful permanent residents. It does not apply to asylum seekers, refugees or children.

The proclamation says immigrants will be barred from entering the country unless they will be covered by health insurance within 30 days of entering or have enough financial resources to pay for any medical costs.

The rule is the Trump administration’s latest effort to limit immigrant access to public programs while trying to move the country away from a family-based immigration system to a merit-based system.

The White House said in a statement at the time the proclamation was issued that too many noncitizens were taking advantage of the country’s “generous public health programs” and that immigrants contribute to the problem of “uncompensated healthcare costs.”

Under the government’s visa rule, the required insurance can be bought individually or provided by an employer and it can be short-term coverage or catastrophic.

Medicaid doesn’t count, and an immigrant can’t get a visa if using the Affordable Care Act’s subsidies, which the federal government pays for. According to the Migration Policy Institute, a nonpartisan immigration think tank, 57% of U.S. immigrants had private health insurance in 2017, compared with 69% of U.S.-born, and 30% had public health insurance coverage, compared with 36% of native-born.

The uninsured rate for immigrants dropped from 32% to 20% from 2013 to 2017, since the implementation of the Affordable Care Act, according to Migration Policy.

About 1.1 million people obtain green cards each year.

“Countless thousands across the country can breathe a sigh of relief today because the court recognized the urgent and irreparable harm that would have been inflicted” without the hold, said Jesse Bless, director of federal litigation at the American Immigration Lawyers Assn.

Earlier this year, the administration made sweeping changes to regulations that would deny green cards to immigrants who use some forms of public assistance, but the courts have blocked that measure.