WASHINGTON — A federal judge on Thursday dismissed a novel lawsuit challenging a censorship system the government uses to ensure that millions of former military and intelligence officials disclose no classified secrets if they write articles and books after leaving public service.

It has become a routine part of gaining a security clearance to consent to prepublication reviews of writings that relate to government work. Over the past 40 years, that system has expanded to cover many more officials and agencies than it did in 1980, when the Supreme Court upheld it in a cursory and unsigned decision.

But in a 57-page opinion, Judge George J. Hazel of the Federal District Court of the District of Maryland ruled that the 1980 precedent still controlled the legal dispute — at least at his level. He wrote that only the Supreme Court can decide if one of its precedents is obsolete in light of changed circumstances.

A Justice Department spokeswoman declined to comment. But Jameel Jaffer, the executive director of the Knight First Amendment Institute at Columbia University, which — along with the American Civil Liberties Union — brought the case on behalf of five former intelligence officials, said they would appeal.