A Tunisian naval guard shot and killed a colleague and two civilians on Tuesday as he tried to reach a synagogue on the Mediterranean island of Djerba during an annual Jewish pilgrimage, the Tunisian Interior Ministry said. The attacker was killed by security guards and 10 people were injured.

The motive for the attack was under investigation. It came as Tunisia, once a prized tourist destination and birthplace of the pro-democracy Arab Spring uprisings, has fallen into political and economic crisis.

Djerba, a picturesque island off the southern coast of Tunisia, is home to the North African country’s largest Jewish community.

The civilians killed were French and Tunisian, the Tunisian Foreign Ministry said. It was not immediately clear if they were pilgrims attending ceremonies at the 2,500-year-old Ghriba temple, one of the oldest synagogues in Africa.

The injured included six security officers and four civilians, the Interior Ministry said. He did not specify how they were injured or if they were all shot by the attacker, who was not publicly identified.

The assailant, a guardsman affiliated with the National Guard’s naval center in the Djerba port city of Aghir, first killed a colleague with his service weapon and then seized ammunition and headed towards the Ghriba synagogue, the ministry said.

When he arrived at the site, he opened fire on security units stationed at the temple, who responded and killed him before he reached the entrance, the ministry said. The synagogue was locked down and those inside and outside were kept safe while authorities investigated the motives for the attack, the ministry said.

Ghayda Thabet, a member of the Tunisian Association for Support of Minorities, was at the Ghriba synagogue and asked for help on Facebook. “They are shooting with live ammunition. Help us,” she pleaded in one post.

Videos circulating online showed terrified visitors running as gunshots rang out.

It happened during an annual pilgrimage that draws thousands of visitors from all over the world to Djerba.

In 2002, a truck bomb killed around 20 people at the entrance to the same temple during the annual Jewish pilgrimage. Al-Qaida claimed responsibility for that attack, whose victims included German and French tourists, as well as Tunisians.

In 2015, a Tunisian attack on the Mediterranean resort of Sousse killed 38 people, mostly British tourists. The Islamic State group claimed responsibility for that attack, along with attacks that year on the famed Bardo Museum in the capital Tunis and on a bus carrying presidential guards.