RIO DE JANEIRO – A judge in Brazil on Thursday sentenced eight men for planning an attack in the run up to the 2016 Summer Olympics, marking the first time that a much debated anti-terror law formed the basis of a case in Latin America’s largest nation.

Federal Judge Marcos Josegrei da Silva sentenced the men to between 6 and 15 years in prison. In the 100-page sentence, da Silva included screen shots of the men extolling the Islamic State group online, both in their words and images. One picture shows one of the men posing in front of a flag with the Islamic State written on it in Arabic.

The harshest penalty went to 33-year-old Leonid El Kadre, who authorities said was the group’s leader. He got 15 years and 10 months.

The judge said that El Kadre had three Facebook profiles that he used to celebrate terrorist attacks being committed in other countries and to swear his allegiance to the Islamic State.

“A Muslim will never be a true believer if he is against Jihad,” or armed struggle, the judge wrote was one of El Kadre’s most common phrases online.

Zaine el Kadri, El Kadre’s mother and lawyer, said the ruling didn’t prove that her son actually committed a crime.

“They have got nothing on him,” she said in a phone interview. “We are going to appeal and get him out.”

El Kadri said her son was entering his 36th day on a hunger strike to protest unjust incarceration.

Weeks before the Olympics, 13 men were arrested in a high-profile operation in July. Five were released a few months later.

The case against them is the first to test a 2016 law that widened the scope of what could be considered terrorism in Latin America’s largest nation.

When the Brazilian Congress passed the law, human rights groups warned that overly broad language could let the government move against protesters and others for simply expressing free speech. The law calls for up to eight years in prison for “advocating terrorism,” and 10 to 20 years for “joining terrorist organizations,” though “terrorism” and “terrorist” are not defined.

When the men were arrested, Brazil’s then-justice minister, Alexandre Moraes, said some of them had pledged allegiance to the I.S. without having personal contact with members of the terrorist group abroad. The men who were arrested never actually met in person and communicated with each other via messaging apps WhatsApp and Telegram, he said.

Moraes called them “amateurs” and “ill-prepared.” The closest the group got to planning an attack was an alleged attempt to buy an AK-47 assault rifle from a store in Paraguay via email, but Moraes said police were justified in acting in light of “lone wolf” attacks in the U.S. and Europe.