Similar in many ways to field and ice hockey, but played barefoot and with palm wood sticks, the ancient game is called "mokhacha" in the local Hassani Arabic dialect.
"We play mokhacha in our spare time," said one participant, Hamadi Boudani, at the recent International Nomads Festival in the southern town of M'hamid El Ghizlane.
"Our ancestors were nomads and as soon as they pitched their camp somewhere they would first rest and then, to pass the time, they would start a game," he said.
"This game is part of Saharan tradition."
The players were cheered on by enthusiastic fans as they churned up the sand in what was once a stop on the storied caravan route to Timbuktu.
They were wearing the daraa, an ample tunic favored by nomadic tribes, and the cheche cloth turban to cover their heads and faces from the desert sun.
The two teams, one in white the other in blue, had a go at it on May 1, during the annual Nomads Festival which also celebrates song and dance and other desert traditions.
Each team is made up of at least seven players, the outline of the pitch is crudely traced by hand in the sand, and the referee is simply known as the sheikh.
- 'Ancestral heritage' -
Sand hockey "is part of our ancestral heritage", said Rachid Laghouanm who heads an association that promotes traditional sports and games in M'hamid El Ghizlane.
"It was handed down from father to son, and it is vital that it does not disappear," he said.
But like other popular or traditional games and sports, "nomad hockey" as it is often called, is fading into oblivion.
"We are trying to create awareness about the game" by organizing competitions and encouraging players to join them, said Laghouanem.
According to the U.K.-based Hockey Museum, which says it is "the first and only museum of hockey in the world," sand hockey has been around as long as any form of hockey has been in existence.
Forms of sand hockey are also enjoyed in Ethiopia, where it is called Genna, and in Tunisia under the name of Oggaf, the museum says on its website.
These and the Moroccan version, it says, "date back over hundreds of years and a number of these games are still thriving, almost unchanged, to this day."
Other experts believe that hockey's precursor was a stick-and-ball game with origins as far back as ancient Greece and Egypt.
Boudani says he does not know which came first, sand, field or ice hockey. But what is clear to him is that "the nomads had no means of knowing that Westerners had a similar game."