RIO DE JANEIRO (Reuters) - Brazilian police in the state of Rio de Janeiro, which hosts the Olympics next month, have arrested a man with suspected ties to terrorist groups after monitoring his online activity, his lawyer said on Thursday.

The lawyer, Edison Ferreira, said Chaer Kalaoun, 28, was detained by police in his home in the town of Nova Iguacu on allegations of posting apologies for Islamic State (IS) online. The lawyer strongly denied his client had any ties to terrorist groups.

Federal police declined to comment.

Ferreira said that police had also detained Kalaoun before Brazil hosted the World Cup in 2014 on charges of illegal possession of firearms.

On July 21 Brazil arrested 10 people suspected of belonging to a poorly organized group that supports IS and discussing terrorist acts during the Olympic Games. It has subsequently detained two more suspects in the case.

South America's first Olympics kick off on Aug. 5 with some 500,000 visitors expected to travel to Brazil. Authorities are on high alert following attacks in France and Germany in recent weeks.

(Reporting by Pedro Fonseca; Writing by Caroline Stauffer; Editing by Jeffrey Benkoe)