Moroccans were working on Sunday to rescue survivors of the nation’s strongest earthquake in more than a century, in which more than 2,000 people were killed.

Soldiers and workers brought water and supplies to mountain villages in ruins as international aid crews remained in limbo waiting for the nation to request their help.

Those left homeless by the destruction of Friday night’s earthquake slept outside on Saturday, in the streets of the ancient city of Marrakech or under makeshift canopies in Atlas Mountain towns like Moulay Brahim, among the hardest-hit.

People inspect their homes damaged in the earthquake
Mountainous villages and cities were not built to withstand such a mighty quake (Mosa’ab Elshamy/AP)

The worst destruction is in small, rural communities that are hard for rescuers to reach because of the mountainous terrain.

The magnitude-6.8 earthquake sent people racing from their beds into the streets and toppled buildings in mountainous villages and cities not built to withstand such a mighty quake.

Some 2,012 people were confirmed dead and at least 2,059 more people were injured — 1,404 critically — Morocco’s interior ministry reported on Saturday night. That number is expected to rise.

“We felt a huge shake like it was doomsday,” Moulay Brahim resident Ayoub Toudite said. “Ten seconds and everything was gone.”

People comfort each other while digging graves for victims of the earthquake
King Mohammed VI ordered three days of national mourning (Mosa’ab Elshamy/AP)

Flags were lowered across Morocco, as King Mohammed VI ordered three days of national mourning starting on Sunday.

The army mobilised specialised search and rescue teams, and the king ordered water, food rations and shelter to be provided to those who had lost their homes.

The king called for mosques across the kingdom to hold prayers on Sunday for the victims, many of whom were buried on Saturday amid the frenzy of rescue work nearby.

Some Moroccans complained on social networks that the government was not allowing more international help.

A rescue workers pauses while taking part in a rescue operation following the earthquake
The army mobilised specialised search and rescue teams (Mosa’ab Elshamy/AP)

Aid offers have poured in from around the world and the UN said it had a team in Morocco co-ordinating with authorities there about how international partners could provide support.

The UN estimated more than 300,000 people have been affected in Marrakech and the surrounding area.

In a sign that Morocco may be prepared to accept help from outside, the Spanish military said it had sent an Air Force plane carrying an urban search and rescue team of 56 soldiers and four dogs to Marrakech to help.

Foreign minister Jose Manuel Albares said in a radio interview that the deployment was in response to a bilateral request for help from Moroccan authorities.

About 100 teams comprising a total of 3,500 rescuers from around the world are registered with a UN platform and are ready to deploy in Morocco but are awaiting a green light from Moroccan authorities, according to the founder of aid group Rescuers Without Borders.

Arnaud Fraisse said the group’s team got stuck at a Paris airport on Sunday waiting for permission from Morocco to enter the country.

“We know there is a great urgency to save people and dig under the remains of buildings,” he said.

“There are people dying under the rubble, and we cannot do anything to save them.”

The epicentre of Friday’s quake — the biggest to hit the North African country in 120 years — was near the town of Ighil in Al Haouz Province, roughly 44 miles (70km) south of Marrakech.

Al Haouz is known for scenic villages and valleys tucked in the High Atlas Mountains.

Families sit outside their destroyed homes following the earthquake
Those left homeless by the destruction of Friday night’s earthquake slept outside on Saturday (Mosa’ab Elshamy/AP)

Some Marrakech shop owners returned to work on Sunday, after the king encouraged economic activities to resume nationwide and ordered plans to begin to reconstruct destroyed buildings.

For much of Saturday in Marrakech, people could be seen on state TV clustering in the streets, afraid to go back inside buildings that might still be unstable.

The city’s famous Koutoubia Mosque, built in the 12th century, was damaged, but the extent was not immediately clear.

Moroccans also posted videos showing damage to parts of the famous red walls that surround the old city, a Unesco World Heritage site.

The US Geological Survey said the quake had a preliminary magnitude of 6.8 when it hit at 11.11pm, with shaking that lasted several seconds.

The agency added that a magnitude-4.9 aftershock hit 19 minutes later.

A car heavily damaged by the earthquake is left on the side of a road
The quake had a preliminary magnitude of 6.8 when it hit at 11.11pm, the US Geological Survey said (Mosa’ab Elshamy/AP)

The collision of the African and Eurasian tectonic plates occurred at a relatively shallow depth, which makes a quake more dangerous.

In 1960, a magnitude-5.8 tremor struck near the Moroccan city of Agadir and caused thousands of deaths.

That quake prompted changes in construction rules in Morocco, but many buildings, especially rural homes, are not built to withstand such tremors.

In 2004, a magnitude-6.4 earthquake near the Mediterranean coastal city of Al Hoceima left more than 600 dead.

Friday’s quake was felt as far away as Portugal and Algeria, according to the Portuguese Institute for Sea and Atmosphere and Algeria’s Civil Defence agency, which oversees emergency response.