A team of archaeologists, historians and engineers had nearly finished a monthslong restoration of the Tinmel Mosque, a 1,000-year-old jewel of Moorish architecture set deep in the mountains of Morocco, when a powerful earthquake barreled through the area a week ago.
By the time it was over, the intricate domes and graceful arches, first built by the dynasty that conquered parts of Spain as well as North Africa in the 12th century, had crumbled.
Tinmel was “a reflection of an extraordinary civilization, the apogee of this civilization,” said Abdallah Fili, an archaeologist and professor at the University of El Jadida who was leading the restoration. “It was a beautiful project. Unfortunately, fate decided otherwise.”
After the disaster, Moroccans grieved for mothers, sons, cousins, neighbors and friends. More than 3,000 died in all, among them five of the workers restoring the Tinmel mosque and living nearby. Many of the survivors lost their homes and everything in them.
But Morocco also suffered a very different kind of loss with the damage or destruction of some of its rich heritage — venerated mosques, exquisitely tiled palaces in Marrakesh and ancient hilltop citadels built by the indigenous Amazighs, or Berbers, who long dominated the mountains where the quake struck hardest.
Word spread first of the well-known monuments of Marrakesh.
Video of the 12th-century Koutoubia Mosque, a city landmark and tourist magnet that towers over the oldest part of Marrakesh, showed its famous minaret listing back and forth during the earthquake, emitting puffs of dust. Cracks appeared inside.
But it was spared the fate of the Kharbouch Mosque, which stands on one end of Djemaa El Fna square — the heart of the city and a major tourist attraction filled with musicians, henna artists and food stalls. The mosque’s minaret collapsed altogether, injuring several people on the way down.
“We’re scared and really psychologically upset,” said Khadija Chuegra, who saw the minaret crumble as she fled her nearby house during the earthquake.
Now she stood near the Koutoubia Mosque, where she and other Marrakesh residents once prayed regularly, filling it during the holy fasting month of Ramadan or the days of Eid. Its square had been sealed off by metal barriers and police tape while experts assessed the damage, but no final diagnosis had been made, according to a government official.
“I would love to go there and pray for the dead,” said Ms. Chuegra, “but I’m afraid it might collapse.”
Elsewhere in Marrakesh, several museums, as well as the 16th-century El Badi Palace (often translated as “The Incomparable”) and the late 19th-century El Bahia Palace (“The Beautiful”) were closed to visitors. Experts have judged them to be in serious condition, and what appeared to be materials for shoring up the structure of El Badi were piled outside the palace on Wednesday.
The palaces stand in the walled ancient core of the city, known as the Medina, a sprawling spiderweb of narrow alleyways lined with doors that can lead to humble apartments or sumptuous riads — mansions built around courtyards and, in many cases, turned into guesthouses. Residents said the apparently untouched or lightly cracked exterior walls of the homes hid serious destruction within.
“Don’t be fooled by all of this,” said Jamila Fouzi, 45, a resident of the Mellah, the historic Jewish quarter in the Marrakesh Medina, as her neighbors packed their belongings into bulging shopping bags, too worried about the state of their homes to sleep there. “Another tremor, and all these walls will come down.”
With aid operations still underway in the badly hit rural areas near Marrakesh, the extent of the damage to the many heritage sites scattered across the Atlas Mountains was not yet clear.
The region is strewn with historically significant monuments, including prehistoric rock engravings, Amazigh casbahs and Muslim and Jewish shrines, mausoleums, mosques and graves. Sitting in remote villages, many have long been neglected, especially compared to their far better-known city counterparts.
Two of the mountain sites that now stand at least partly in ruins were monuments to the once-dominant power of Amazigh tribal chiefs who ruled over the Atlas Mountains, including the Glaoui and Goundafi families. They built huge citadels, or casbahs, that towered over mountain passes as symbols of their power and influence.
When Morocco broke away from France’s rule, the families lost prominence and the casbahs — now symbols of defiance toward the new authorities — were left to rot, said Brahim El Guabli, a Williams College professor who researches Amazigh and Arab culture.
The casbahs were “brilliant demonstrations of Amazigh architectural know-how,” he said. “The trade and the meticulous construction patience that went into making them is important to preserve for future generations, even after the material effects of the earthquake are over.”
The Goundafi casbah, which stood near the epicenter of the quake, is now mostly destroyed, Professor El Guabli said.
The 18th-century Glaoui casbah in the village of Telouet, which the Glaouis ornamented like a royal Moorish palace at the height of their power and wealth, was already largely a wreck before the quake. Now, the intact portion that visitors could see before the disaster is also badly damaged, according to Abderrahman El Glaoui, a descendant who helps oversee the casbah for the family.
Once, the casbah guarded the trade route between the northern and southern Atlas Mountain ranges, where pilgrims bound for Mecca also passed on their way from southern Morocco into the Sahara toward Algeria and eventually Saudi Arabia. Now it overlooks a miles-long swath of utter destruction.
Mr. El Glaoui said his family lacked the means to restore the ruin and would look to the government for support — support that has previously been absent from this region, for heritage sites and marginalized villages alike.
“After the sadness, after the terrible shock, after, I would say, the grieving,” Mr. El Glaoui said, “I think that this will compel a new spirit. Because really, those areas in the mountains are lagging behind, so I hope that this is an opportunity for those regions to move ahead.”