MARRAKECH, Morocco — A rare, powerful earthquake struck Morocco, sending people racing from their beds into the streets and toppling buildings in mountainous villages and ancient cities not built to withstand such force. More than 2,000 people were killed, and the toll was expected to rise as rescuers struggled Saturday to reach hard-hit remote areas.

The magnitude 6.8 quake, the biggest to hit the North African country in 120 years, sent people fleeing their homes in terror and disbelief late Friday. One man said dishes and wall hangings began raining down, and people were knocked off their feet. The quake brought down walls made of stone and masonry, covering whole communities with rubble.

The devastation gripped each town along the High Atlas’ steep and winding switchbacks in similar ways: Homes folding in on themselves and mothers and fathers crying as boys and helmet-clad police carried the dead through the streets.

Hamid Idsalah, a 72-year-old mountain guide, said he and many others remained alive but had little to look forward to. That was true in the short term — with remnants of his kitchen reduced to dust — and in the long term — where he and many others lack the financial means to rebound.

“I can’t reconstruct my home. I don’t know what I’ll do. Still, I’m alive, so I’ll wait,” he said as he walked through the desert oasis town overlooking red rock hills, packs of goats and a glistening salt lake. “I feel heartsick.”

Meanwhile, President Joe Biden was among world leaders expressing sadness at the devastation facing the North African kingdom.

Biden said Saturday that U.S. officials had been in contact with Morocco to offer help.

“We are working expeditiously to ensure American citizens in Morocco are safe, and stand ready to provide any necessary assistance for the Moroccan people,” Biden said. “The United States stands by Morocco and my friend King Mohammed VI at this difficult moment.”

Turkey, which lost tens of thousands of people in a massive earthquake earlier this year, was among those proposing assistance. France and Germany, with large populations of people of Moroccan origin, also offered to help. Israel’s Foreign Ministry said the government has been in touch with Moroccan officials about the possibility of providing help or rescue assistance.

In an exceptional move, neighboring rival Algeria offered to open its airspace to allow eventual humanitarian aid or medical evacuation flights to travel to and from Morocco. Algeria closed the airspace when its government severed diplomatic ties with Morocco in 2021 over a series of issues. The countries have been in a decadeslong dispute involving the territory of Western Sahara.

On Moroccan state TV, people could be seen clustering in the streets of historic Marrakech, afraid to go back inside buildings that might still be unstable. Many wrapped themselves in blankets as they tried to sleep outside.

Marrakech’s famous Koutoubia Mosque, built in the 12th century, was damaged. Its 226-foot minaret is known as the “roof of Marrakech.”

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

At least 2,012 people died in the quake, mostly in Marrakech and five provinces near the epicenter, Morocco’s Interior Ministry reported Saturday night. At least another 2,059 people were injured, the ministry said.

“The problem is that where destructive earthquakes are rare, buildings are simply not constructed robustly enough to cope with strong ground shaking, so many collapse, resulting in high casualties,” said Bill McGuire, professor emeritus of geophysical and climate hazards at University College London. “I would expect the final death toll to climb into the thousands once more is known.”

Morocco’s king ordered the armed forces to mobilize specialized search and rescue teams and a surgical field hospital.

Despite an outpouring of offers of help from around the world, the Moroccan government had not formally asked for assistance, a step required before outside rescue crews can provide assistance.

Ayoub Toudite said he had been working out with friends at a gym in Moulay Brahim, which is carved into a mountainside south of Marrakech, when “we felt a huge shake like it was doomsday.”

In 10 seconds, he said, everything was gone.

The epicenter of Friday’s tremor was near the town of Ighil in Al Haouz province, 44 miles south of Marrakech. Al Haouz is known for scenic villages and valleys tucked in the High Atlas Mountains.

In Ijjoukak, a village in the area surrounding Toubkal, North Africa’s tallest peak, residents estimated nearly 200 buildings had been leveled. “It felt like a bomb went off,” Mohamed Messi, 34, said.

Morocco will observe three days of national mourning, the official news agency MAP reported.