A five-year-old Moroccan boy who was trapped in a well for four days has died, despite painstaking efforts to rescue him.
A royal statement announced his death soon after his removal from the well.
The bid to free the boy, named as Rayan, had gripped the country, with hundreds of people gathered at the well and thousands more following online.
The boy plunged 32m (104ft) through the well’s narrow opening. The rescue had been hampered by fears of a landslide.
Rescuers finally brought the boy out of the well on Saturday evening.
No word had been given at the time about his condition, and the apparent rescue was initially met with cheers from the crowds.
On social media, people using the hashtag #SaveRayan, which had been trending across the country and beyond, expressed their jubilation.
But this turned to heartbreak minutes later when the statement came announcing that Rayan had died.
Twitter users then began paying tribute and expressing sadness using the same hashtag.
“Following the tragic accident which cost the life of the child Rayan Oram, His Majesty King Mohammed VI called the parents of the boy who died after falling down the well,” the statement from the royal palace said.
The king had expressed his deepest condolences and sincere compassion, it added.
Rayan’s father was repairing the well at the time of the accident on Tuesday. He told local media the following day that his son had fallen down the shaft at “that one moment I took my eyes off him”, adding: “I haven’t slept a wink.”
Led by Morocco’s Civil Protection Directorate, rescue operations in the small northern town of Tamorot, around 100km (62 miles) from the city of Chefchaouen, began on Tuesday evening.
Footage on Thursday from a camera lowered into the well showed that the boy was alive and conscious, but there had been no update on his condition since then.
Rescuers tried to get oxygen, food and water to the boy but it was unclear whether he was able to use them.
The mixture of rocky and sandy soils meant rescuers deemed opening the water well’s narrow shaft to be too dangerous.
Instead, bulldozers were used to cut a huge trench next to the well.