Humans inhabited the Balearic archipelago as early as 5000 b.c. , having most likely journeyed to the islands from the coast of mainland Spain .
It was a long and perilous journey from mainland Spain to the Balearic archipelago .