Two-year-old Julen Rosello was interred alongside his brother Oliver who died in 2017 aged three after suffering cardiac problems.
A crowd at the entrance to the cemetery in Malaga in southern Spain applauded as the little boy's family arrived for the burial.
The accident on January 13 sparked a nearly two-week operation to try to locate Julen in the borehole that had been sunk illegally.
Despite hopes he might be found alive, rescuers eventually found his body early on Saturday morning.
Rescuers in the town of Totalan were not able to get to Julen via the well he fell down because it was blocked by a layer of earth, sand and stones believed to have been dislodged when he tumbled in.
After unsuccessfully trying to suck up the blockage using machines, they decided to dig a vertical shaft parallel to the well and then dig a four-metre tunnel to join both channels.
Local daily Malaga Hoy, citing sources, said a post-mortem found Julen died on the same day he fell from a “traumatic brain injury”.