On medical advice, the child and his mother were taken by helicopter to a hospital in Lanzarote. The authorities have not reported any other complications.
“It was Three Kings Day and it was the best gift we could have received,” helicopter commander Alvaro Serrano Perez told Reuters.
Crossing the ocean from Africa to the Canary Islands is notoriously dangerous.
More than 46,800 undocumented migrants took the route last year to reach the islands, Spanish government data showed this month.
The Christian feast of the Epiphany, when observers mark the visit of Jesus by Magi – commonly known as the Three Kings, or Wise Men – is widely celebrated in Spain.
Children clean their shoes on the eve of the event known as “El Dia de los Reyes” (The Day of the Kings) and leave them ready for the Three Kings – Melchior, Caspar and Balthazar – to put gifts in them.