Denmark's prime minister Lars Løkke Rasmussen was among hundreds of mourners at the funeral of a 24-year-old tourist murdered while hiking in Morocco.

Louisa Vesterager Jespersen, from Denmark, was killed alongside Maren Ueland, 28, from Norway, while camping in the Atlas Mountains on 17 December.

Their mutilated bodies were found by other tourists the next day, with Danish officials suggesting the killing was as an "act of terror" linked to Isis.

The four main suspects reportedly pledged allegiance to Isis in a video made three days before the murders.

The 45-minute funeral for Ms Jespersen was held on Saturday at the Fonnesbæk Church in Ikast, in Denmark's Mid Jutland region.

Family and friends follow the coffin during the funeral of Danish student Louisa Vesterager Jespersen at Fonnesbaek Church in Ikast, Denmark (Denmark OUTBO AMSTRUP/AFP/Getty Images)

According to Danish newspaper BT, 400 people attended the funeral and an extra room was opened to accommodate all of the guests.

Prime minister Lars Løkke Rasmussen said: "Though the pain is unbearable, we must not succumb.

"We must remember who we are, what we are Rasmussenmade of, and what we stand for."

Earlier this month, Mr Rasmussen told reporters that the murder of Ms Jespersen and Ms Ueland can be considered “politically motivated and thus an act of terror”.

Danish Prime Minister Lars Lokke Rasmussen, right, attends the funeral of Danish student Louisa Vesterager Jespersen in Ikast, Denmark (Bo Amstrup/Ritzau Scanpix via AP)

Moroccan authorities have arrested 22 people in connection with the killing, including four main suspects believed to have been inspired by Isis and a Swiss-Spanish national who was allegedly associated with the murderers.

However, police spokesman Boubker Sabik has described the killers as “lone wolves” and claimed “the crime was not coordinated with Islamic State”.

But he also accused the Swiss-Spanish man arrested over the murders of "involvement in recruiting Moroccan and sub-Saharan nationals to carry out terrorist plots in Morocco against foreign targets and security forces in order to take hold of their service weapons”.

Despite producing a large contingent of Isis recruits, there has been little terrorist activity in Morocco since a 2011 bombing in Marrakech killed seven people, most of them European tourists.

Support free-thinking journalism and attend Independent events

The remains of Ms Jespersen and Ms Ueland were found by French tourists in a tent at a campsite near Mount Toubkal, the highest peak in the Atlas Mountains. They were reportedly on a month-long hiking trip.

Ms Ueland's funeral will be held in Norway on 21 January.