The office of Morocco's prosecutor said four men seen in the video that was circulating on Twitter and recorded last week were the same four in custody for the slayings of the young women, whose bodies were discovered Monday.
Moroccan authorities had said they considered the killings in a remote region of the Atlas Mountains to be a terrorist act and were investigating if the suspects had extremist ties, but hadn't named a particular group.
Other tourists found the two women, one from Norway and the other from Denmark, with stab wounds in their necks, according to national media in Morocco. Investigators have video surveillance footage showing three people putting up a tent near the victims' tent, the media outlets said.
The footage also shows the three leaving the area, near a village that is a frequent starting point for treks to Mount Toubkal, North Africa's highest peak, the outlets said. Danish Prime Minister Lars Loekke Rasmussen confirmed the identities of the victims, 24-year-old Louisa Vesterager Jespersen, of Denmark, and Norwegian citizen Maren Ueland, 28. The University of South-Eastern Norway said both women were students at its campus in Boe, southern Norway.
"What should have been a holiday trip turned into a nightmare" for the women, Loekke Rasmussen told reporters in Denmark. Earlier Thursday, Denmark's domestic security agency told The Associated Press that preliminary findings the investigation "indicate, according to Moroccan authorities, that the killings may be related to the terrorist organization the Islamic State group."
The killings were "politically motivated and thus an act of terror," Denmark's Loekke Rasmussen said, without identifying the potential motives. "There are still dark forces that want to fight our values" and "we must not give in."
In neighboring Norway, Prime Minister Erna Solberg said terrorism "is not the only lead that is being investigated in Morocco," but the case "emphasizes the importance of combating violent extremism."
"We trust that Moroccan authorities are doing their utmost to arrest those responsible for the murders," she said at a news conference. The slayings have shocked Morocco, a popular tourist destination where attacks on foreigners are extremely rare. In the capital of Rabat, government spokesman Mustapha El Khalfi said Morocco condemned "this terrorist, criminal act."
"It is an unacceptable act that does not fit with the values and traditions of Moroccan people nor the traditions of the area where the crime happened," Khalfi said Thursday. It is a denounced, condemned act."
The three suspects arrested Thursday were stopped while they were trying to leave Marrakech on a bus, Moroccan national security spokesman Boubker Sabik said. The first suspect was arrested Tuesday, and authorities aren't pursuing others besides the four, Sabik said.
A national security official who asked not to be named because he wasn't authorized to speak to the media said the three had knives and slingshots when they were arrested. The official identified them to The Associated Press as Abdessamad Ejjoud, born in 1993; Younes Ouziad, born in 1991; and Rashid Aftati, born in 1986.
Morocco is generally considered safe for tourists but has battled with Islamic extremism for years. More than a thousand Moroccans are believed to have joined the Islamic State group. An anti-terrorism rally is being planned for Saturday in Rabat.
Amira El-Masaiti reported from Rabat, Morocco.