Workers retrieved the body of a young boy who was trapped for five days in a well in northern Morocco, a devastating end to a painstaking operation that gripped the nation.
The royal palace said in a statement carried by state media on Saturday that the boy had died before rescuers could save him.
Moroccan King Mohammed VI expressed his condolences to the boy’s parents.
“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 said.
An Associated Press reporter at the scene saw the boy wrapped in a yellow blanket after he was carried out from a tunnel dug specifically for the rescue.
His parents had been escorted to an ambulance before the body emerged. The ambulance reversed into the deep cut that rescue teams had excavated and took away the body.
The boy’s plight captured worldwide attention. Online messages of support and concern for Rayan poured in from around the world as the rescue efforts dragged on.
Footage posted on social media showed the scene after his body was recovered, with hundreds of distraught rescue workers and onlookers gathered at the site chanting and shining the flashlights of their phones into the air.
Workers with mechanical diggers worked around the clock to save the five-year-old child after he fell into a 32-metre (100-feet) deep well in the hills near Chefchaouen on Tuesday.
The well was just 45cm (18 inches) wide at the top and narrowed further to the bottom, making it impossible for rescuers to descend directly.
The effort was a delicate and dangerous operation, constantly delayed by heavy rocks and imperilled by the threat of landslides.
Across the country, Moroccans followed the saga on television in homes and cafes.
“I am so sad to learn Rayan has died. Sincere condolences to the parents,” said Abderrahim Sabihi, a resident of the capital Rabat who was following the rescue effort from a cafe.
Images on Moroccan media earlier had shown Rayan huddled at the bottom of the disused well.
Hundreds of villagers stood waiting nearby for news as the rescue operation continued on Saturday.
A male relative of the boy told Reuters TV the family first realised he was missing when they heard muffled cries and lowered a phone with its light and camera on to locate him.
“He was crying ‘lift me up’,” the relative said.
The hilly region around Chefchaouen is bitterly cold in winter. Food and water were lowered to the child, and he was also supplied with water and oxygen using a tube.