Rescue crews in Spain have recovered the body of a two-year-old boy, whose fall into a deep borehole almost two weeks ago prompted a complex and heart-wrenching search-and-rescue operation.

Key points: The young boy's remains were found by rescuers digging a tunnel to reach him

The young boy's remains were found by rescuers digging a tunnel to reach him The Civil Guard is investigating whether the borehole had been made illegally

The Civil Guard is investigating whether the borehole had been made illegally Spaniards, including King Felipe Felipe VI, have paid tribute to the boy

Julen Rosello fell down the narrow 110-metre-deep hole on January 13 while his family was preparing a countryside Sunday lunch.

Adding to the family's tragedy, Spanish media had reported that his parents had another young son who died of a heart attack in 2017.

Julen's remains were found in the early hours of Saturday by rescuers digging a tunnel to reach him, said Alfonso Rodriguez, the Spanish government's representative for the southern region of Andalusia.

They were accompanied by a member of the Civil Guard, which then took charge of removing the body.

Mr Rodriguez said that the results of the boy's autopsy would remain secret under a judicial commission following up with the accident's investigation.

The Civil Guard was investigating if the borehole had been made illegally.

The tragedy had gripped Spaniards from day one and the country had followed closely every turn of an extremely complex operation, frequently hampered by layers of hard rock.

Spain's King Felipe VI and Spanish Prime Minister Pedro Sanchez both offered their condolences to the family.

"All of Spain shares in the infinite sadness of Julen's family," Mr Sanchez wrote on Twitter.

"We have followed each step taken to reach him. We will always be grateful for the tireless effort of those who worked to find him during these days. My support and warmth to his parents and loved ones."

Candles formed in the shape of a heart in remembrance of Julen, pictured near his house in southern Spain. ( Reuters: Jon Nazca )

The dry waterhole, only 25 centimetres in diameter, was too narrow for an adult to get into and hardened soil and rock blocked equipment from progressing to the place two-thirds of the way down where the toddler was trapped.

During the nearly two weeks of the ordeal, officials came up with several alternative routes to the toddler.

A series of small explosions set off since Thursday afternoon, including a fourth one late on Friday, helped the crews make their way through a 3.8-metre-long horizontal tunnel to the cavity.

Before that tunnel could be dug some 70 metres underground, a vertical shaft was drilled during days of painstaking engineering to bring miners and rescue experts up and down.

Spanish media reported Julen's parents lost another young son two years ago. ( AP: Alex Zea )

Only hair that matched Julen's DNA was found in the borehole and no other verbal or visual contact had been established with him.

Despite that, officials had refused to speculate over whether the boy could have survived so long.

In one of the few media interviews the child's parents gave before the body was found, father Jose Rosello said the family was "heartbroken" by the long wait but hoping for "a miracle".

El Pais reported that the couple had lost Julen's older brother, Oliver, when the three-year-old suffered a heart attack during a walk on the beach two years ago.

AP