Four suspects in the killing of a pair of Scandinavian tourists in Morocco earlier this week swore fealty to Isis while standing beneath a makeshift flag of the jihadi group in a video that surfaced online on Thursday, showing the potency and geographical breadth of a network that US President Donald Trump said was defeated a day earlier.

Hours before, Denmark called the gruesome murder of two female tourists in a rural, mountainous part of Morocco a politically motivated “act of terror”, a day after authorities tied a suspect in the killing to a militant group.

The bodies of the two women, Louisa Vesterager Jespersen, 24, of Denmark, and Maren Ueland, 28, of Norway, were discovered Monday in the Atlas Mountain range near the tourist hotspot of Marrakech, Morocco’s official news agency said. Moroccan authorities on Tuesday arrested at least one person in connection with the murder and later detained three others.

The killing can be considered “politically motivated and thus an act of terror”, Danish prime minister Lars Lokke Rasmussen told reporters on Thursday.

“What should have been a holiday trip turned into a nightmare,” he said. “Two women were killed in a bestial manner. We respond with dismay, disgust and deep sorrow.”

The killers allegedly recorded their ambush. They stabbed each woman and decapitated one with what appears to be a kitchen knife.

“This is for Syria,” a man is heard saying in the video, suggesting sympathy for Isis.

It remains unclear whether the suspects were battle-hardened veterans of Isis in Syria, Iraq or Libya, or were inspired by the group and radicalised themselves via the internet.

“People here are quite shocked,” Issandr el Amrani, Rabat-based North Africa director of the International Crisis Group, told The Independent.

“It’s unprecedented in Morocco and, especially if linked to a transnational jihadist group, a worrying development considering Morocco – unlike Algeria or Tunisia – did not have armed groups hiding in the mountains, or anything similar.”

A Moroccan prosecutor said at least one suspect under arrest had ties to militant groups, without identifying any organisation or network, according to the official MAP news agency.

Maren Ueland (Facebook)

Al-Qaeda in the Islamic Maghreb operates in much of North Africa, and Moroccan Isis recruits returning from Syria and Iraq are a major security concern.

Verdens Gang, a Norwegian tabloid newspaper, cited unnamed sources in the Moroccan prosecutor’s office as saying all four suspects had sworn allegiance to Isis. A statement by Danish security forces cited by The Associated Press also described suspected Isis links, though there has not yet been a claim of responsibility.

The remains of the two women were found by French tourists in a tent at a campsite near Mount Toubkal, the highest peak in the Atlas Mountains that is popular with climbers. The victims, both passionate about the outdoors, were reportedly on a month-long hiking trip.

Louisa Vesterager Jespersen (Facebook)

“I’m going to Morocco in December,” Ms Jespersen wrote on her Facebook page 21 November. “Any of you guys who’s around by then, or any mountain friends who knows something about Mount Toubkal?”

Norwegian criminal investigators have joined Moroccan counterparts in sorting through surveillance camera footage from local businesses and interviewing potential witnesses, local media reported. Photographs of three of the four suspects have been issued.

Despite producing a large contingent of Isis recruits, terrorist attacks are relatively rare in Morocco, a struggling kingdom of 36 million people dependent on remittances from immigrants in Western Europe, tourism, phosphate exports and European investment.

Unlike Casablanca and its surrounding shantytowns, the Marrakesh area has had little militant activity since a 2011 bombing attack on a popular cafe killed 17 people. The city recently hosted a number of high-profile conferences that drew the likes of former US secretary of state Madeleine Albright and hosted this month’s UN global summit on migration.