Updated

A judge in Brazil has sentenced eight men to prison sentences for declaring allegiance to the Islamic State group online and planning an attack in the run up to the 2016 Summer Olympics.

The 13 men were arrested in the high-profile operation in July, just weeks before the Olympic Games kicked off in Rio de Janeiro. Five were released a few months later.

The arrests were the first launched under a much-debated law that widened the scope of what could be considered terrorism in Latin America's largest nation.

Federal Judge Marcos Josegrei da Silva sentenced the men Thursday to between 6 and 15 years in prison.

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.