The royal palace announced Saturday that a 5-year-old boy died after being trapped in a deep water well in Morocco for four days.

In a statement, the palace released, the Moroccan King Mohammed VI offered condolences to his parents.

After a long operation that captured global attention, Rayan was freed by rescuers Saturday night.

A reporter from the Associated Press saw the boy covered in a yellow blanket as he emerged of a tunnel that was made specifically for rescue.

Before the boy arrived, his parents Khaled Oram (and Wassima Khersheesh) were escorted to an ambulance. His story was widely reported.

According to the palace statement, the king was closely monitoring the rescue efforts of local authorities and “instructed officials to use every means necessary to get the boy out the well and bring him home to his parents.” The king thanked the community and rescuers for their tireless efforts, as well as the community’s support for Rayan’s family.

Many villagers and others gathered to witness the rescue operation.

As the rescue efforts continued for four days, online messages of support and concern pouring in from all over the globe for the boy.

Rescuers used a rope and a camera to monitor the child’s condition. Abdelhadi Temrani (head of rescue committee) stated that it was impossible to assess the child’s health at this point. We pray that the child is still alive.

Rayan was thrown into a well measuring 32 meters (105 feet) outside his house in Ighran, Morocco’s northern mountainous Chefchaouen Province on Tuesday evening.

Three days ago, the search teams used bulldozers and excavators to dig a parallel ditch. On Friday, the search crews began digging a horizontal tunnel in order to reach the boy trapped. According to Morocco’s MAP news agency, topographical engineers were sought out for their assistance.

Temrani spoke to 2M local television to say that rescuers only had two meters (yards), left to dig the hole in which the boy was trapped.

He said that the diggers came across hard rock while on their journey and had to be careful not to create landslides or cracks. It took five hours to remove the rock. The digging was slow, and the work was done carefully to avoid cracks below the ground. This could have been dangerous for the child’s life as well as rescue workers.

Because of the possibility that the soil around the well might collapse, the work was particularly difficult.

This village, home to approximately 500 people, is filled with deep wells that are used to irrigate the cannabis crop. It is the main source for income for many living in remote, poor and arid regions of Morocco’s Rif Mountains. Protective covers are common for most of the wells.

It is not clear what the exact circumstances were when the boy fell into the well.

Nationwide, Moroccans took to social media to express their hope for the boy’s survival. They used the hashtag #SaveRayan, which brought attention worldwide to rescue efforts.