Tunisia and France declared “solidarity in the face of terrorism” on Friday after at least 37 people, mostly tourists, were murdered by gunmen in the North African state and a man was beheaded by an attacker proclaiming allegiance to ISIL at a French gas factory.

The French president Francois Hollande and his Tunisian counterpart Beji Caid Essebsi, who spoke by telephone after the two atrocities, reaffirmed their resolve to defeat the “scourge” of extremist violence.

Some commentators have identified broad links between the incidents, coming a few days before the first anniversary of ISIL’s declaration of a caliphate and after recent threats of more attacks against the West.

The mass murder of holidaymakers at the Tunisian beach resort of Sousse was carried out just three months after 22 people, most of them foreign visitors, were killed by a gunman at the Bardo museum in the capital Tunis.

Tunisians and tourists from several countries including the UK, Germany, Ireland and Belgium were reportedly among those killed on Friday. Another 36 people were wounded.

The attacker was killed by security forces. A photograph of his body, his weapon by his side, was distributed on social media.

Police said he was a student originally from the Kairouan region in central Tunisia and was not known to them. “He entered by the beach, dressed like someone who was going to swim, and he had a beach umbrella with his gun in it,” the secretary of state for security Rafik Chelly said.

Other photographs circulating on Twitter showed holidaymakers, presumably victims, lying face down on the beach.

Steve Johnson, a British tourist, told the BBC: “We were just lying on the beach as usual and we heard what we thought at first was fireworks. But it was soon pretty obvious ... that it was firearms that were being discharged and people screaming and starting to run.”

The Tunisian president, facing a concerted campaign to destroy an already weakened tourism industry, said his country could not stand up to the terrorist threat by itself.

“We note that Tunisia faces an international movement,” he said. “It cannot respond alone to this. On the same day at the same time France has been the target of such an operation, and Kuwait too,” he added, referring to a suicide bombing on a Shiite mosque in Kuwait City,

“This proves the need for a global strategy and that all democratic countries must now join forces.”

The attack was condemned by the Arab Parliament as a cowardly act that had “nothing to do with religion or Arabism”, speaker Ahmed bin Mohammed Al Jarwan said.

In the latest terrorist incident to strike France, the murder of a delivery firm boss was seen as part of an attempt to blow up the US-owned Air Products and Chemicals industrial gas factory at Saint-Quentin-Fallavier, near the south-eastern city of Lyon.

Mr Hollande and French officials said extremist inscriptions were found on flags left at the scene and also scrawled on the victim’s severed head, which was attached to the gates of the plant.

One attacker was quickly identified by the French interior minister Bernard Cazeneuve as Yassin Salhi, who had previously been under surveillance for suspected links with extremism.

He was overpowered and detained by a security officer after entering the factory. Mr Cazeneuve described the attack as a “barbarous” terrorist crime.

Local media reports said another man, seen driving to and from the factory before the attack, was arrested later at his home nearby. Police were also said to have held other suspected accomplices but it was not immediately clear whether a second active participant was still at large.

Reports suggested that the murdered man may have been killed away from the factory before his body was taken there. Reuters quoted a source close to the investigation as saying that the victim was aged 50 and had been due to travel with the suspect to make a delivery at the site.

At least two other people were injured but Air Products said all staff had been accounted for.

A van carrying one or possibly two men was used to ram the entrance to the plant, according to officials. Reports differed on whether the impact detonated gas canisters or separate attempts were made to cause explosions inside the plant, or both.

But the French president said there was no doubt that the intention had been to blow up the factory, located in an industrial zone in the Isere area known as “chemical valley” because of its concentration of gas and chemical sites.

Air Products is based in Pennsylvania. Its president is Seifi Ghasemi, an Iranian-born graduate of Abadan Institute of Technology.

Mr Hollande urged the French people “not to give in to fear” as he cut short his attendance at a European Union summit in Brussels to return to Paris for an emergency session of his defence council. He said France’s security level would be raised to its highest status, with thousands of police officers deployed.

The attack came six months after French-Algerian brothers, Said and Cherif Kouachi, murdered 12 people, including journalists, cartoonists, two police officers and a maintenance worker, at the Paris offices of the satirical magazine Charlie Hebdo. Both were later killed after police cornered them at the premises of a printing company.

In related attacks in the French capital, one of the Kouachis’ associates, Amedy Coulibaly, shot dead four hostages at a Jewish supermarket and a municipal policewoman. He, too, was killed by police.

In April, a woman was murdered in Paris as her car was being stolen, allegedly by an Algerian-born student suspected of planning an attack on worshippers at one or more Catholic churches.

He was arrested after accidentally shooting himself in the leg, though he has since denied killing the woman and claimed he was trying to prevent an attack on churchgoers.

Like Mr Hollande, the French prime minister, Manuel Valls was out of France when the gas plant was attacked shortly before 10am local time.

Mr Valls, on an official visit to the Colombian capital of Bogota, said: “The blind horror and threat of terrorists spares no country. My thoughts are with the victim in Isere and the victims in Tunisia.”

French reports said the wife and a sister of the detained suspect were also held for questioning in the Lyon suburb of Saint Priest as part of the investigation into the attack.

Earlier, Salhi’s wife had told the French radio station Europe 1: “We are normal Muslims. We’re observing Ramadan. We have three kids and a normal family life. Who can I call to give me more information, because I don’t understand what’s going on?”

The woman said her husband, the father of their three children, was a delivery man who had left for work at 7am and was due home by 2pm.

“I don’t know what happened,” she said. “My sister-in-law told me to switch on the TV, and the news was on. And then she started to cry. It feels like my heart is going to stop.

“I know him as my husband. We have a normal family life. He leaves for work, he comes home.”

Mr Cazeneuve said that Salhi had been investigated from 2006 for suspected extremist links. But he had no criminal record and surveillance was discontinued in 2008.

This follows a familiar pattern in France. The Kouachi brothers and Coulibaly were also known to security agencies, as was Mohamed Merah, the self-styled Al Qaeda gunman who murdered seven people, including three Jewish children, before being killed by police in a siege of his flat in the south-western city of Toulouse in 2012.

But Friday’s attack once again demonstrates the limits of surveillance and heightened security measures.

French police and troops have been guarding tourist locations, stations, airports, synagogues, schools and other locations since the Charlie Hebdo murders. There was also enhanced security at sensitive industrial sites.

But security analysts say it would take up to 30 officers to maintain round-the-clock monitoring of each suspect.

While Mr Valls spoke after the thwarted church attack of at least five terrorist incidents being averted in recent months, western governments acknowledge that extremists operating in open societies will always have a capability to commit an atrocity against an unexpected target.

The French prime minister said more than 1,500 French citizens or residents, including 442 currently believed to be in Syria, had been implicated in “terror networks”.

An ISIL spokesman, Abu-Muhammad Al Adnani, said this week that the US president Barack Obama and his allies should expect “setbacks and surprises”.

foreign.desk@thenational.ae

* With additional reporting from Agence France-Presse