The body of a five-year-old boy has been recovered from a well in northern Morocco.
The boy, Rayan Awram, fell into the well at his village in the hills near Chefchaouen on Tuesday, triggering a huge rescue effort that engrossed the country.
Rescue teams recovered his body from the well this evening.
Two government officials said Rayan had died before rescuers managed to reach him.
Rescuers removed much of the adjacent hillside and tunnelled a horizontal passage into the well to reach the boy.
King Mohammed sent condolences to his parents, a statement carried by state media reported.
The complex and risky earth-moving operation had gripped residents of the North African kingdom and beyond, also sparking sympathy in neighbouring Algeria, a regional rival.
A camera inserted into the well where Rayan was stuck had shown him, from behind, lying on his side, said Abdelhadi Tamrani, an official in charge of the operation.
Thousands of people gathered and even camped in solidarity around the search site in recent days, where AFP reporters said the tension had been palpable.
The shaft, just 45 centimetres across, was too narrow to reach Rayan, and widening it was deemed too risky - so earth-movers dug a wide slope into the hill to reach him from the side.
The operation made the landscape resemble a construction site. It involved engineers and topographers, and was made more complex by the mix of rocky and sandy soils.
Overnight they worked non-stop under powerful floodlights that gave a gloomy air to the scene.

The incident echoed a tragedy in Spain in early 2019 when a two-year-old child died after falling into an abandoned well 25 centimetres wide and more than 70 metres deep.
Julen Rosello's body was recovered after a search and rescue operation that lasted 13 days.