Brazilian police have arrested ten members of a group allegedly planning terrorist attacks during the upcoming Olympic Games, according to the country's Justice Minister.

The group, made up of Brazilians, allegedly declared loyalty to the self-proclaimed Islamic State organisation and discussed buying weapons.

"There was an order between them to start training in martial arts and to (obtain) ammunition, weapons with which they could carry out an act," Minister Alexandre de Moraes told a press conference.

"This was in progress. One of them had got in contact with an underground weapons site in Paraguay, asking to buy an AK47" assault rifle, he said.

"This was crucial because it proves an act of preparation."

The group was monitored when it discussed the alleged plans in Internet communications, the minister said. It was not clear how far concrete preparations had progressed.

In a statement, the justice ministry said that it had launched "Operation Hashtag to break up a group involved in the promotion of Islamic State and the preparation for carrying out terrorist attacks and other criminal acts."

About 130 officers took part in the operation in which ten were arrested and two more temporarily detained, the statement said.

The arrests and 19 searches were conducted in states across the country, ranging from the Amazonas region to the financial capital Sao Paulo and Rio de Janeiro, where the Olympics open on 5 August.

Last week, Brazil said it was bolstering security for the games following the truck attack in the French city of Nice, which killed 84 people and left scores badly wounded. The attack has been claimed by IS.

The Brazilian intelligence agency ABIN last month picked up messages in Portuguese that it said were linked to the group.

Brazil's Olympics security plan calls for the mobilisation, starting on the 24 July, of some 85,000 members of the security forces.

These include 47,000 police officers and 38,000 military service members tasked with protecting the 10,500 athletes, and some 500,000 tourists expected to come from all parts of the world.