Two students in northern New Jersey can wear buttons featuring a picture of Hitler youth to protest a school uniform policy, a federal judge ruled Thursday.

U.S. District Judge Joseph A. Greenaway Jr. sided with the parents of the students, who had been threatened with suspension by the Bayonne school district last fall for wearing the buttons. However, the judge added in his ruling that the boys will not be allowed to distribute the buttons at school.

"I'm very pleased," said Laura DePinto, mother of one of the students. "I think it upholds the most basic of our American rights, which is to protest peacefully."

Citing a 1969 case in Iowa involving students who wore black arm bands to protest the Vietnam War, Greenaway wrote that "a student may not be punished for merely expressing views unless the school has reason to believe that the speech or expression will 'materially and substantially disrupt the work and discipline of the school."'

Greenaway's decision "follows the law as we saw it going in," said Karin R. White Morgen, an attorney representing both boys' families. "We believed that it was the Tinker decision that applied," she added, referring to the Iowa case.

The buttons bear the words "no school uniforms" with a slash through them superimposed on a photo of young boys wearing identical shirts and neckerchiefs. There are no swastikas visible on the buttons, but the parties agreed that they depict members of Hitler youth.

Bayonne instituted mandatory uniforms last September for grades K-8, and fifth-grader Michael DePinto wore the button several times before objections were raised in November, attorneys for the plaintiffs said.

In a letter dated Nov. 16, 2006, Janice Lo Re, principal of Public School 14, notified Laura DePinto that her son "will be subject to suspension" for wearing the button in school.

Parents of the other student, Anthony LaRocco, a seventh-grader at the Woodrow Wilson School, received a similar letter from principal Catherine Quinn.

After the suspension threat, the boys' parents filed a federal lawsuit claiming the district stifled the children's First Amendment free speech rights. They also have mounted a legal challenge to the uniform policy.

Neither boy has worn the button since the lawsuit was filed, Morgen said.

District lawyers asserted that the image of the Hitler youth was abhorrent because it conveyed intolerance and racial inequality represented by Nazism.

Messages left on Thursday with Bayonne Superintendent of Schools Patricia L. McGeehan and district attorney Robert Merryman were not immediately returned.