The original psalm 22 (verses 2-23) is thought to date from 587 BC. Verses 24-27 were likely added between 538 BC and 1 AD. The most recent portion of the composition, verses 28-32, is considered to date from between 350 and 400 AD.
These dates are important because the psalm includes much imagery that is reused in the Christian gospels of the new testament, which were written long after it. Here is the first line:
My God, my God, why have you forsaken me? Why are you so far from helping me, and from the words I am roaring?
The first sentence contains the exact words spoke by Jesus on the cross in the two earliest gospels, Mark (15:34) and Matthew (27:46). It seems likely that the author of Mark took the words from psalm 22 and put them in the mouth of the dying Jesus. Later, the authors of Luke and John, finding these words incongruent with their more evolved Christologies, changes Jesus’s dying words to better suit their narratives.
The psalm continues:
Oh my God, I cry in the daytime, but you do not hear, nor in the night, though I am not silent. But you are holy, you who inhabit the praise of Israel. Our fathers trusted in you. They trusted, and you delivered them. They cried to you, and were delivered. They trusted in you, and were not confounded. But I am a worm, and no man, reproached by men and despised by the people. All who see me laugh at and scorn me. They shoot out their lips and shake the heads.
“He trusted that the Lord would deliver him. Let Him deliver him, seeing He delighted in him,” they say.
Compare this to the statement in Mark: “The chief priests mockingly said among themselves and the scribes, ‘He saved others, yet he cannot save himself? Let Christ the King of Israel descend now from the cross, that we may see and believe.'” — Mark 15:31-32
You are the one that took me out of the womb. You gave me hope when I was at my mother’s breast. I was cast upon you from the womb. You were my God from my mother’s belly.
Do be not far from me, for trouble is near, and there is no one to help. Many bulls have surrounded me. The strong bulls of Samaria have beset me. They gape at me with their mouths, like ravening, roaring lions.
I am poured out like water, and all my bones are out of joint. My heart is like wax; it lies melted amidst my bowels. My strength has dried up like a clay potsherd, and my tongue cleaves to my mouth. You have brought me into the dust of death.
What comes next is an amazing passage, written hundreds of years before the birth of Jesus:
Dogs have surrounded me. The assembly of the wicked have enclosed me. They pierced my hands and my feet. I may tell all my bones. They stare at me. They share my garments among themselves, and cast lots for my robe.
Again, Mark seems to have taken imagery from the psalm: “And when they had crucified him, they parted his garments, casting lots for them, what every man should take” — Mark 15:24
Don’t be far from me, oh Lord. Oh my strength, hasten to help me. Deliver my soul from the sword, my darling from the power of the dog. Save me from the lion’s mouth, and from the horns of the bulls.
I will declare your name to my kindred. In the midst of the congregation will I praise you. You who fear the Lord, praise him. All you descendants of Jacob, glorify Him. Fear Him, all you children of Israel.
The next section was added shortly before the birth of Jesus:
Yahweh does not despised nor abhor the affliction of the afflicted; neither has he hidden his face from them. When they cried to him, he heard. I shall praise Him in the great congregation: I will pay my vows before those that fear Him.
The meek shall eat and be satisfied: they shall praise the Lord that seek him: your heart shall live for ever. To the ends of the earth, all shall remember and turn to the Lord, and all the kindreds of the nations shall worship before Him.
This final part, scholars believe was added after Jesus died:
For the kingdom is the Lord’s, and he is the governor of the nations. All those who prosper upon earth shall eat and worship. All those that go down to dust shall bow before him. None can keep alive his own soul.
A future generation shall serve the Lord. They shall come, and shall declare His righteousness to the people yet to be born, and that He has done this.