Rayan fell down a 32-metre (100-foot) dry well, prompting a difficult earth-moving effort to retrieve him without triggering a landslide.
On social media, well-wishers expressed their condolences and prayed that he would be rescued alive.
Crowds rejoiced as rescue personnel cleared the final handfuls of soil to reach him after the lengthy digging effort on Saturday night.
But hope was dashed when it was revealed that the boy had died, according to the North African country’s royal council.
King Mohammed VI called the parents to voice his condolences.
The child’s body was taken to a military hospital in the capital Rabat, accompanied by his parents, as villagers started preparing the area around the Douar Zaouia cemetary near Ighrane in anticipation of a large crowd of mourners.
His funeral is to be held on Monday afternoon in his home village of Ighrane, in the impoverished Rif mountains of northern Morocco, a local official and a relative told AFP.
Rayan’s father Khaled Aourram said he had been repairing the well when his son fell in, close to the family home.
The shaft, just 45 centimetres (18 inches) across, was too narrow for Rayan to be reached directly, and widening it was deemed too risky — so earth movers dug a wide slope into the hill.
Rescue crews, using bulldozers and front-end loaders, excavated the surrounding red earth down to the level where the boy was trapped, before drill teams carefully dug a horizontal tunnel to reach him from the side to avoid causing a landslide.
Vast crowds came to offer their support, singing and praying to encourage the rescuers who worked around the clock.
But the boy’s death left Moroccans in shock.
Mourad Fazoui in the capital Rabat mourned what he said was a disaster. “May his soul rest in peace and may God open the gates of heaven to him,” the salesman said.
The Arabic daily newspaper Assabah criticised the digging of unauthorised wells, saying many were used to irrigate cannabis widely grown in Morocco’s north.
Social media across the Arab world were flooded with messages of support, grief, and praise for rescue workers.
“He has brought people together around him,” one Twitter user said.
But one deplored a “dystopic world” where “Arab nations are moved by the rescue of a child in Morocco” while other infants in Yemen and Syria die in famine or conflict.
Breaking News
Mine Crypto. Earn $GOATS while it is free! Click Here!!TDPel Media
This article was published on TDPel Media. Thanks for reading!