Hundreds of mourners carried Rayan’s coffin, and laid him to rest two days after he passed away.
Rayan was confirmed dead late Saturday by authorities after an ongoing rescue attempt failed to save him.
The five-year-old boy had been trapped since Tuesday before being retrieved by rescue teams from the well on Saturday, but did not survive his ordeal, state media reported.
Rayan’s parents were transferred to the cemetery in an ambulance, both distressed and in tears as seen on local broadcaster, Chouf TV.
Rayan’s rescue efforts gripped much of the country with the hashtag #SaveRayan trending in North Africa and other parts of the world.
The child was stuck in a well that reached more than 100 feet (30 meters) underground in the Chefchaouen province.
She said he was playing nearby before he disappeared, and that she quickly called authorities after finding out what had happened.
An outpouring of grief
King Mohammed VI of Morocco offered condolences to Rayan’s family in a phone call, according to a statement from the Royal Palace.
“Following the tragic accident that claimed the life of the child Rayan Oram, His Majesty King Mohammed VI, may God protect him, made a phone call to Mr. Khaled Oram, and Mrs. Wassima Khersheesh, the parents of the deceased who passed away, after falling into a well,” the statement said
While French President Emmanuel Macron said that he shared in the pain and grief felt by Rayan’s family and the people of Morocco.
Rayan was also mourned by Israeli Prime Minister Naftali Bennett and Dubai ruler Mohammed bin Rashid.