French police have arrested a 16-year-old boy who allegedly posted a message on social media saying he wanted to launch a suicide attack during this summer’s Paris Olympics.

The boy announced on social media that he planned to make an explosive belt, the counterterrorism prosecutor’s office said. Police are investigating whether he genuinely intended to commit an act of terrorism.

The teenager, who is French, said he wanted to “die as a martyr in the name of the Islamic caliphate”, a source close to the investigation said.

He was arrested at his parents’ home in Marignier, a town near the Swiss border, according to the television news channel BFM. A search of the property found a handwritten declaration of allegiance to Islamic State.

The suspect is said to have told investigators that he wanted to carry out an attack with a suicide belt or a gun at La Défense, the business district in western Paris, during the Olympics, which begin in July.

He is being held in custody while detectives determine how far his plan had advanced and if it was serious.

The arrest comes with France on its highest level of terror alert amid fears that the Olympics could be targeted.