RABAT/COPENHAGEN (Reuters) - Moroccan authorities said on Thursday that four suspects in the murder of two female Scandiniavian tourists in the Atlas Mountains had pledged allegiance to Islamic State before the killings.

The bodies of Louisa Vesterager Jespersen, 24, from Denmark and Maren Ueland, 28, from Norway, were found on Monday in an isolated area near Imlil, on the way to Toubkal, North Africa’s highest peak and a popular hiking destination.

Police arrested a suspect on Tuesday in the tourist hub of Marrakech who they said belonged to a militant group. Three more were picked up later in the city, the Central Bureau for Judicial Investigations said.

Morocco’s general prosecutor on Thursday confirmed the authenticity of a video in which he said the four pledged allegiance to Islamic State and its leader Abu Bakr al-Baghdadi.

In the video, which was posted on social media, the suspects threatened to carry out attacks, the general prosecutor said in a statement.

Investigations by the bureau also showed the video was made last week before the killing of the two women. The evidence discovered so far pointed to a terrorist motive, the bureau said.

Preliminary investigations of the video found that it was shot in a different place from where the women’s bodies were found, a police source told Reuters.

Danish intelligence said earlier on Thursday that Islamic State could be behind the killings.

“The video and preliminary investigation according to the Moroccan authorities indicate that the killings may be related to the terrorist organization Islamic State,” the Danish intelligence service said in a statement.

Slideshow ( 4 images )

“This is a case of an unusually bestial killing of two totally innocent young women,” it said.

Before leaving, Jespersen had posted on Facebook about her upcoming trip.

“Dear friends, I’m going to Morocco in December. Any of you guys who’s around by then or any mountain friends who knows something about Mount Toubkal?”

Compared to other countries in North Africa, Morocco has been largely insulated from militant attacks. The most recent took place in April 2011, when 17 people were killed in a bombing of a restaurant in Marrakech.

“This is a brutal and meaningless attack on innocent people, which we react to with disgust and condemnation,” Norwegian Prime Minister Erna Solberg said in a statement.

The Bureau for Judicial Investigations, established in 2015, says it has so far broken up 57 militant cells, including eight in 2018.