A five-year-old boy trapped for several days inside a Moroccan well has died, the royal palace announced Saturday.

“Moroccan King Mohammed VI expressed his condolences to the boy’s parents in a statement released by the palace,” the Associated Press (AP) reported.

The boy, whose name was Rayan, was pulled from the hole late Saturday by rescue crews following a long operation that drew the world’s attention.

An AP reporter at the scene witnessed the child wrapped in a blanket once he came out of the tunnel dug amid the rescue efforts.

“His parents, Khaled Oram and Wassima Khersheesh had been escorted to an ambulance before the boy emerged,” the outlet continued:

The palace statement said the king had been closely following the frantic rescue efforts by locals authorities, “instructing officials to use all means necessary to dig the boy out of the well and return him alive to his parents”. The king hailed the rescuers for their relentless work and the community for landing support to Rayan’s family.

Crowds of villagers and other people had gathered to watch rescue crews during the operation.

Video footage showed the scene and the child’s relatives sharing their grief at the news:

Online messages expressing support and concern for the child came in from all over the world during the initial operation. Crews had used rope to get oxygen and water down to him and a camera to monitor his condition.

Per the AP article:

Rayan fell into a 32-meter (105-feet) well located outside his home in the village of Ighran in Morocco’s mountainous northern Chefchaouen province on Tuesday evening. 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.

A man identified as Rayan’s father said the child was with him when he repaired the well, NBC News reported Saturday.

“Rayan was next to me,” he explained after a translation. “At one point he fell. I didn’t realize it.”