From the production notes of the movie (which can be found
here, and is a pretty good read) JJ Abrams says flat out:
“He’s a baby. He’s brand-new. He’s confused, disoriented and irritable. And he’s been down there in the water for thousands and thousands of years.”
Regardless of what the director implies, if the creator says that, then I believe it didnt come from space.