The alert was raised by the teenage son of one of the friends after discovering the boy floating in the water.
One of the parents at the villa tried to revive him before paramedics, who had been called to the villa, took over.
The child was pronounced dead at the scene.
The tragedy happened just before 9pm on Sunday at the villa, which is a short drive from La Cala de Mijas, on the coast between Marbella and Fuengirola.
A judge has been placed in charge of an investigation into the incident.
An autopsy was due to take place this morning in Malaga.
The funeral is expected to take place no sooner than Wednesday.