Another example of how ancient and established the concept is. From Homer's Iliad (composed 8th century BC and set several centuries earlier), the ghost of Patroclus visits the sleeping Achilles....
"But
Achilles lay sighing heavily, among his
Myrmidons, by the echoing shore, out in the open just above the breaking surf. His strong limbs were weary from hunting Hector round windy Troy, yet no sooner had sleep seized him, shedding sweetness round him and easing his heart’s cares, than the spirit of poor
Patroclus appeared, the very semblance of the man himself, with the same stature, eyes, and clothes, and it was his voice that spoke saying: ‘You sleep, and forget me, Achilles. You neglect me now I’m dead, as you never did when I was alive. Hasten my funeral, and let me pass
Hades’ Gate. The spirits keep me out, the shades of men done with toil, who will not let me join them beyond the river, but leave me wandering in vain this side of the yawning Gate. And clasp my hand, I beg you, for once you’ve given me to the fire, I shall not return. You and I will never sit apart from our dear friends and talk as we once did, now that mortal fate has consumed me: that fate appointed for me at my birth. You too, godlike Achilles, are doomed to die beneath the walls of Troy. One more thing I ask of you, if you will. Don’t bury my ashes far from yours, Achilles. Let them be as one, just as we were when we grew up together.
Menoetius brought me, to your house, a child from
Opoeis, because I killed
Amphidamus’ son, accidentally, in a foolish quarrel over a game.
Peleus, the horseman, welcomed me to his palace, showed me loving care, and made me your squire. So let one urn enclose our ashes, the golden urn your royal mother gave you.’
Fleet-footed Achilles answered: ‘Why, when you are here, dear heart, do you come only to ask such things? I will see to it all, just as you wish, but now come closer, so that, if only for a moment, we might clasp our arms round one another, and sate ourselves with sad lament.’
So saying, he stretched out his hands in vain. The spirit vanished like smoke beneath the earth, gibbering faintly. Achilles sprang up in turmoil, and beat his hands together, crying sadly: ‘There now! Even in Hades’ House something of us survives, spirit and semblance, but no power of response: for all night long poor Patroclus’ shade, his very likeness, stood over me, weeping, lamenting, saying what I must do.’ "