A federal judge struck down a New York City rule Tuesday that required fast-food restaurants to post calorie counts on their menus, but he suggested that expanding the rule to include more restaurants could make it legal.

U.S. District Judge Richard J. Holwell said he determined the rule conflicted with federal law. Businesses had claimed that their First Amendment free speech rights were violated by the rule, described as the first of its kind in the U.S., but Holwell said he reached his decision without needing to address those claims.