The Moroccan royal palace said Saturday that a 5-year-old boy who was trapped in a deep well for four days has died.
Moroccan King Mohammed VI expressed his condolences to the boy's parents in a statement released by the palace.
The boy, Rayan, was pulled out Saturday night by rescuers after a lengthy operation that captivated global attention.
An Associated Press reporter at the scene saw the boy wrapped in a yellow blanket after he emerged from a tunnel dug specifically for the rescue.
His parents had been escorted to an ambulance before the boy emerged. His plight had captured worldwide attention.
Online messages of support and concern for the boy poured in from around the world as the rescue efforts dragged through the night.
Rescuers used a rope to send oxygen and water down to the boy as well as a camera to monitor him. By Saturday morning, the head of the rescue committee, Abdelhadi Temrani, said: "It is not possible to determine the child's condition at all at this time. But we hope to God that the child is alive."
Rayan fell into a 105-feet well located outside his home in the village of Ighran in Morocco's mountainous northern Chefchaouen province on Tuesday evening. He was trapped in a hole too narrow for rescuers to reach safely.
For three days, search crews used bulldozers to dig a parallel ditch. Then on Friday, they started excavating a horizontal tunnel to reach the trapped boy. Morocco's MAP news agency said that experts in topographical engineering were called upon for help.
Temrani, speaking to local television 2M, said Saturday that rescuers had just two meters (yards) left to dig to reach the hole where the boy is trapped.
"The diggers encountered a hard rock on their way, and were therefore very careful to avoid any landslides or cracks," he said. "It took about five hours to get rid of the rock because the digging was slow and was done in a careful way to avoid creating cracks in the hole from below, which could threaten the life of the child as well as the rescue workers."
The work has been especially difficult because of fears that the soil surrounding the well could collapse on the boy.
His distraught parents were joined by hundreds of villagers and others who had gathered to watch the rescue operation.
The village of about 500 people is dotted with deep wells, many used for irrigating the cannabis crop that is the main source of income for many in the poor, remote and arid region of Morocco's Rif Mountains. Most of the wells have protective covers.
The exact circumstances of how the boy fell in the well are unclear.
Nationwide, Moroccans had taken to social media to offer their hopes for the boy's survival, using the hashtag #SaveRayan which has brought global attention to the rescue efforts.
Additional reporting by The Associated Press.