NEW YORK – The city’s campaign to scare smokers with grotesque images of decaying teeth or a diseased lung wherever tobacco products are sold was struck down Wednesday by a federal judge who concluded that only the federal government can dictate warnings that must accompany the promotion of cigarettes.

U.S. District Judge Jed S. Rakoff handed a victory to the nation’s three largest tobacco manufacturers and the retailers who sell their products when he ruled on the legality of a 2009 city Board of Health code change requiring the display of smoking cessation signs where tobacco products are sold.

“Even merchants of morbidity are entitled to the full protection of the law,” Rakoff said. He released the decision just days before an agreement among the parties to delay enforcement of the rule was to expire Saturday.

He said the federal Labeling Act sought to balance public and commercial interests with a federal program to deal with cigarette labeling and advertising.