WASHINGTON — A federal judge on Thursday struck down a Trump administration rule that allows small businesses to band together and set up health insurance plans that skirt requirements of the Affordable Care Act.

The rule is “clearly an end-run around the A.C.A.,” said the judge, John D. Bates, of the Federal District Court for the District of Columbia.

The ruling was the second big defeat this week for President Trump on a top-priority item on his health care agenda as he has sought to use the courts to obliterate his predecessor’s signature achievement. Another judge on Wednesday blocked Medicaid work requirements in Arkansas and Kentucky.

Mr. Trump promoted the small-business health plans as a way to save people from the “nightmare of Obamacare.” He told small-business owners in June that “you’re going to save massive amounts of money and have much better health care.”