The Supreme Court ruled Monday that human rights advocates led by a USC professor could be prosecuted if they offered advice to a foreign terrorist group, even if the advice was to settle disputes peacefully.

The 6-3 decision upholds the 1996 law that makes it a crime for Americans to provide “material support” to a designated foreign terrorist group, including by offering them expert advice or training.

Chief Justice John G. Roberts Jr. said the need to combat terrorism trumped the concern over restricting freedom of speech. The court, he said, agreed with Congress and the president that “providing material support to a designated foreign terrorist organization — even seemingly benign support — bolsters the terrorist activities of that organization.”

Monday’s ruling sends a warning to international aid groups and charities that even good-will measures could ensnare them in a criminal prosecution. Until now, the government has used the law mostly to prosecute those who sent money to a terrorist group or who traveled abroad to undergo training at an Al Qaeda camp.

“All this ruling does is it continues to marginalize Americans. It doesn’t marginalize terrorist groups,” said Amjad Atallah, co-director of the Middle East task force at the liberal New America Foundation in Washington. “It tells Americans you can’t be engaged in conflict resolution in these areas.”

The suit challenging the law was filed 12 years ago by USC professor Ralph Fertig, a founder of the Humanitarian Law Project in Los Angeles. Fertig, who says he opposes violence, said he wanted to advocate for the Kurdish people before a United Nations tribunal, but he feared that in the process he might make contact with members of the Kurdistan Workers Party, known as the PKK, which has been designated as a terrorist group by the State Department.

He argued that the words “advice” and “training” should not be read broadly to cover those who advised others to steer away from violence and terrorism.

Fertig won before federal judges in California, who said parts of the anti-terrorism law were vague and conflicted with the 1st Amendment. U.S. Solicitor General Elena Kagan, now a Supreme Court nominee, appealed on behalf of the Obama administration and won a reversal Monday in Holder vs. Humanitarian Law Project.

Joining Roberts in the ruling for the government were Justices John Paul Stevens, Antonin Scalia, Anthony M. Kennedy, Clarence Thomas and Samuel A. Alito Jr.

In his opinion, Roberts emphasized that Fertig and others were free to speak out on their own on behalf of the Kurds. They violate the law only when they work with members of the PKK, he said. The group, which seeks an independent state for the Kurds, has waged a “violent insurgency” against Turkey, he said.

In dissent, Justice Stephen G. Breyer said the 1st Amendment should protect the “pure speech” of these human rights advocates from prosecution, except when it could be shown that they knew they were aiding “unlawful terrorist actions.” Justices Ruth Bader Ginsburg and Sonia Sotomayor joined his dissent.

“This is a very dark day … but we will not let this inhibit our commitment to the Kurdish people,” Fertig said. “We will continue to advocate for the rights of the Kurds who are being oppressed. We do so with great fear that some of the people we are working with might be members of the PKK.”

Some legal experts said they were surprised the court upheld a criminal law that targets speech and advocacy. In January, the court struck down on free-speech grounds a 63-year-old law that forbade corporations and unions from spending money on an election campaign. In April, the justices cited free speech in voiding a law that made it a crime to sell videos of animals being tortured.

In Monday’s opinion, Roberts said national security raised a higher concern. The Constitution empowered the government “to provide for the common defense,” he said, and the 1st Amendment does not stand in the way of a law that forbids any aid to foreign terrorists.

Among those applauding the ruling was the Anti-Defamation League. “One cannot provide ‘humanitarian’ support in the form of training, expert advice or assistance … to a terrorist organization without helping their bottom line and facilitating violence, destruction and murder,” said Chairman Robert G. Sugarman and Director Abraham H. Foxman in a statement.

Georgetown law professor David Cole, who represented Fertig on behalf of the Center for Constitutional Rights, said he was “deeply disappointed” with the ruling. “In the name of fighting terrorism, the court said that the 1st Amendment permits Congress to make it a crime to work for peace and human rights. That is wrong. There is no evidence that teaching human rights would further terrorism.”

david.savage@latimes.com

Jennifer Martinez of the Washington bureau contributed to this report.