"Eli, Eli, lama sabachthani?" (Matthew 27:46, Mark 15:34) appears to be a quote from Tehillim 22.2. Was Jesus saying G-D had forsaken him? Or was he merely quoting from Tehillim (Psalms) 22.2 (as an expression of Praise in his hour of death)?
Jesus is directly quoting the first line of Psalm 22:
My God, my God, why have you forsaken me? Why are you so far from saving me, from the words of my groaning?
Psalm 22: ESV
The Psalm describes crucifixion centuries before the Romans developed it as a method of capital punishment. It also forecasts details which were out of the ordinary in the case of Jesus' crucifixion.
Compare 22:7,8 with Matthew 27:41-43
All who see me mock me; they make mouths at me; they wag their heads; “He trusts in the Lord; let him deliver him; let him rescue him, for he delights in him!” -- Ps 22:7,8
Finds its fulfillment in:
And those who passed by derided him, wagging their heads and saying, “You who would destroy the temple and rebuild it in three days, save yourself! If you are the Son of God, come down from the cross.” So also the chief priests, with the scribes and elders, mocked him, saying, “He saved others; he cannot save himself. He is the King of Israel; let him come down now from the cross, and we will believe in him. 43 He trusts in God; let God deliver him now, if he desires him. For he said, ‘I am the Son of God.’ ” -- Matt 27:41-43
A pre-Roman description of crucifixion
In 22:14,15 the description in the Psalm is an apt description of crucifixion which includes disjointed shoulders and dehydration
I am poured out like water, and all my bones are out of joint; my heart is like wax; it is melted within my breast; my strength is dried up like a potsherd, and my tongue sticks to my jaws; you lay me in the dust of death. -- Ps 22:14,15
This finds fulfillment in John 19:28. Notice the John points out Jesus is fulfilling scripture by thirsting.
After this, Jesus, knowing that all was now finished, said (to fulfill the Scripture), “I thirst.” -- John 19:28
Noteworthy details in the case of Jesus
In another very striking parallel, Gentiles gamble for his clothes (Dogs is a slur for Gentiles) after piercing his hands and feet. Compare 22:16,17 with Matthew 27:35
For dogs encompass me; a company of evildoers encircles me; they have pierced my hands and feet— I can count all my bones— they stare and gloat over me; they divide my garments among them, and for my clothing they cast lots. -- Ps 22:16,17
This finds fulfillment when the Roman soldiers decide not to tear his one-piece garment, but rather cast lots for it while he hangs, naked on a cross.
And when they had crucified him, they divided his garments among them by casting lots. -- Matt 27:35
Is Jesus is prophesying and fulfilling prophecy?
It may be that Jesus is prophesying. He is calling his countrymen's attention to the fact that he is literally fulfilling the scriptures as they watch. During much of his teaching Jesus is aware that he is fulfilling the scriptures and claims to be doing so. Perhaps this is one extraordinary example.
Is Jesus crying out to God because he feels forsaken?
Surely. Jesus is expressing the same anguish expressed by David in his Psalm. After all, the weight of the world is upon him.
Has the Father abandoned him?
It should not be made too much of that he says "why have you forsaken me?" because this is a Psalm of lament, a genre which expresses human emotions such as despair rather than makes full theological statements.
It is common in the Psalms to ask why God has done something and then reaffirm that God is faithful. It is an emotional poetic form which expresses doubt and then answers that doubt by reaffirming God's character.
Wikipedia (quoting John Day in his commentary of the Psalms), describing Psalms of Lament: "They typically open with an invocation of Yahweh, followed by the lament itself and pleas for help, and often ending with an expression of confidence. A subset is the psalm of confidence, in which the psalmist expresses confidence that God will deliver him from evils and enemies."
The expression of confidence happens in verse 24:
For he has not despised or abhorred the affliction of the afflicted, and he has not hidden his face from him, but has heard, when he cried to him. --Ps 22:24
This is one good reason not build an entire doctrine (God has forsaken Jesus) on a single emotional expression.
I don't think it's to find any support for the former option in the rest of the New Testament. (In penal substitution atonement theory, I believe there is some sense in which the Son was separated from the Father, but this can only be justified on external grounds, not from the writings of the New Testament.)
It seems far more likely that Jesus is quoting the Psalm, and not just that verse, but the entirety of it. Christ's immediate situation fits Psalm 22:1 quite well, but I think more significantly he is looking forward especially to the realization of verses 27 through 31, which speak to Israel's vocation as a light to all nations, and their eventual repentance.
In one patristic Christian understanding, Jesus quotes the Psalm here to show that He is truly human.
[He shows] that He was truly man, and not just in appearance. For man avidly desires life and has a physical appetite for it. Just as Christ agonized and was sorely troubled before the cross, showing the fear that is ours by nature, so now He says, "Why hast Thou forsaken Me?" displaying our natural thirst for life. For He was truly man and like us in all respects, but without sins.1
An alternative explanation (also summarized by Theophylact) is that He was speaking out as a lament for the Jews, who would be handed over to destruction for what they had done:
For as Christ was one of the Jews, He said, "forsaken Me," meaning, "Why hast thou forsaken my kinsmen, My people, that they should bring such a great evil upon themselves.2
1. Explanation of the Holy Gospel According to St. Matthew (Chrysostom Press, 1992), p.248
I guess, the discussion of the passage should start from the Christological premises: who is Jesus and can He be abandoned by the Father, and if no, in what sense, and if yes, in what sense?
From the Gospels we know that He is God's only-Begotten Son, the term "only-Begotten" meaning that He is not a part of the creation, for all the rest - even the highest angels, seraphs and cherubs etc. and all the heavenly hosts + humans - are not "begotten" but created, and that He is always together with the Father in Heavens even after the Incarnation (in fact, John 3:13: "the Son of Man, who is in Heaven" is said with exactly the same power as Matt. 6:9 "Our Father, who are in Heaven"). Moreover, the Fathership and Sonship of divine Persons denote pre-creational relationship, and as such, pre-temporal, or supra-temporal, i.e. eternal one, for the time came to existence only together with the created universe measured by it, and since that unbreachable relationship is eternal, it is also necessary, and thus the Son is God in no lesser sense than the Father (John 1:1-2). Thus, it is ontologically impossible for the divine Person, Hypostasis of the Son to be abandoned by the Divine Hypostasis of the Father.
Having established that, we can move to the analysis of the passage, and multiple plausible interpretations are possible. For example, as being fully man, for He accepted the entire human nature, He can speak as a man, that He as a man is abandoned by the justice and mercy of God, which every man should have from other men: that is to say, God cannot wish a just man to be sadistically killed on a cross; God cannot wish that a judicial authority - the procurator Pilate - would act unjustly by condemning to death a person, while being convinced in his innocence (Luke 23:4); God cannot wish that people, instead of showing mercy and compassion to the one, who did so many good deeds on their behalf, callously deride him at the time of his torture, as it is described in the Gospels.
Thus, Jesus as the Logos of God is with the Father even while hanging on the cross, but as a man, or more precisely, as the divine Person who made human nature His own, and inseparably so, He is not shown a godly treatment from His own nation, He is abandoned from being treated in a due, godly way - as the Son of God, as the true Messiah and the true King of the Eternal Kingdom.
Thus, "God, why have you abandoned me?" - that is to say, "Why it is that I am not understood by my own people? Not treated as I should be treated according to Your - and My - will? Why, instead, I undergo those horrible sufferings? Why am I abandoned from Your "will to be done on earth as it is in Heaven", and thus on earth is happening that, which cannot be Your - and Our - will, because even a small sin cannot be Your will, but here happens not a small sin, but a sin of an infinite dimension - for they are subjecting to a sadistic torture and death Your only-begotten Son, who showed them innumerable benevolences - healings, feedings, expulsions of demons, forgiveness of sins, resurrections of the dead; and it cannot be God's will that He is abandoned even by His disciples - except for John - who had not enough love towards Him as to comfort Him by their courageous presence at His final hours.
Thus, while saying "God why do You abandon Me", Jesus does not mean that He is abandoned by the Father, for He is not and, moreover, cannot be ever separated from the Father, but that He is abandoned by God's will as working in the people, in humans around Him, for due to the people's stony hearts, God's will is not working in them, and therefore Jesus as man, as the divine Person in human nature is also abandoned by God in this sense, undergoing unspeakable sufferings, which He could have escaped had God's will been done.
Eventually, since His divine Person/Hypostasis is in an integral unity with His human nature ever after the Incarnation, we can say, that "God had suffered" and "God was abandoned" without any qualms and with a full theological justification.
Not to forget about the quotation of the Psalm 22: yes, Jesus definitely quotes it, and with a purpose to show, that the Psalmist prophesied about Him many centuries ago. In fact, Jesus claims that not only here, but in many other passages, that Psalms - and not only Psalms, but other divinely inspired prophetic books of the Jewish tradition - prophesize about Him personally (cf. Luke 24:45, or Matt 22:45), and this particular Psalm is most clearly doing so, for in the same psalm also is said: "they pierced my hands and my feet", and "they divide my clothes and cast lot on my garment" (Psalm 22:16-18) - which all happened with a photographical exactitude, for His hands and feet were pierced by nails, His clothes divided, and on His garment the Roman soldiers threw lots (Matt 27:35). And abandoned He was also, in the sense explained above.
At this point in Matthew's narrative (27:39-50) he tells us of the attitudes, ideas and words of those involved with or observing Jesus' death to compare and contrast them to Jesus' own attitudes, ideas and words regarding his death. Ostensibly there is a language barrier but the incident was either concocted or included because the misunderstanding of his prayer allows Matthew to reveal how they didn't "get" what was going on. They all imagined that the Jewish and Roman establishment were in charge and that Jesus wanted to be rescued from death BUT in reality God was in charge Jesus wanted to be rescued by God through death. This passage is tightly coupled with his prayer in Gethsemane and his arrest in the previous chapter.
He was taunted and challenged to escape from his predicament in a challenge with a strong parallel with that of the devil:
Mat 27:39 Those who passed by kept insulting him, shaking their heads, Mat 27:40 and saying, "You who were going to destroy the sanctuary and rebuild it in three days—save yourself! If you are the Son of God, come down from the cross!"
Mat 4:2 After fasting for 40 days and 40 nights, he finally became hungry. Mat 4:3 Then the tempter came. "Since you are the Son of God," he said, "tell these stones to become loaves of bread." Mat 4:4 But he answered, "It is written, 'One must not live on bread alone, but on every word coming out of the mouth of God.'"
In both situations Jesus does not save himself, not because he can't but because he mustn't. His obedience was not only "to the cross" but "as far as death on the cross" (Phil 2):
Mat 26:52 Jesus told him, "Put your sword back in its place! Everyone who uses a sword will be killed by a sword. Mat 26:53 Don't you think that I could call on my Father, and he would send me more than twelve legions of angels now? Mat 26:54 How, then, would the Scriptures be fulfilled that say this must happen?"
His failure to be rescued by God (or Elijah) is derided as proof positive that he's not the son of God:
Mat 27:41 In the same way the high priests, along with the scribes and elders, were also making fun of him. They kept saying, Mat 27:42 "He saved others but can't save himself! He is the king of Israel. Let him come down from the cross now, and we will believe in him. Mat 27:43 He trusts in God. Let God rescue him, if he wants to do so now. After all, he said 'I am the Son of God.'" Mat 27:44 In a similar way, the bandits who were being crucified with him kept insulting him.
In his "darkest hour" he utters a prayer that is mistakenly interpreted as a call to Elijah to come and save him:
Mat 27:45 From noon on, darkness came over the whole land until three in the afternoon. Mat 27:46 About three o'clock, Jesus cried out with a loud voice, "Eli, eli, lema sabachthani?", which means, "My God, my God, why have you forsaken me?" Mat 27:47 When some of the people standing there heard this, they said, "He's calling for Elijah."
But in reality he was praying to God asking him, why, despite his fervent prayers to die quickly he is still alive and suffering. My translation: "My God, my God, why have you left me here in the lurch?":
God's Word translation: Heb 5:7 During his life on earth, Jesus prayed to God, who could save him from death. He prayed and pleaded with loud crying and tears, and he was heard because of his devotion to God.
Some responded to his "plea" with pity. Again, this shows that they did not understand his mission:
Mat 27:48 So one of the men ran off at once, took a sponge, and soaked it in some sour wine. Then he put it on a stick and offered Jesus a drink of wine in order to dull his pain. He tasted it but did not drink it.
The fact that he tasted but did not drink becomes a simile of the fact that he would likewise "taste death" but not drink to the dregs the contents of the "cup" of the "pangs of death":
Heb_2:9 But we see Jesus, who was made a little lower than the angels for the suffering of death, crowned with glory and honour; that he by the grace of God should taste death for every man.
Others either suggested that it was still an open question whether or not he would be saved OR mocked because they believed his death to be inevitable:
Mat 27:49 But the others kept saying, "Wait! Let's see if Elijah will come and save him."
After his prayer and the symbolic "taste", Jesus' prayers were answered and he supernaturally died:
Mat 27:50 Then Jesus cried out with a loud voice again and died.
His death was so inexplicable to the soldiers that it was doubly ensured by piercing his side with a spear:
Mar 15:44 Pilate was surprised to hear that he should have already died. And summoning the centurion, he asked him whether he was already dead. Mar 15:45 And when he learned from the centurion that he was dead, he granted the corpse to Joseph.
Joh 19:31 Since it was the day of Preparation, and so that the bodies would not remain on the cross on the Sabbath (for that Sabbath was a high day), the Jews asked Pilate that their legs might be broken and that they might be taken away. Joh 19:32 So the soldiers came and broke the legs of the first, and of the other who had been crucified with him. Joh 19:33 But when they came to Jesus and saw that he was already dead, they did not break his legs. Joh 19:34 But one of the soldiers pierced his side with a spear, and at once there came out blood and water. Joh 19:35 He who saw it has borne witness—his testimony is true, and he knows that he is telling the truth—that you also may believe. Joh 19:36 For these things took place that the Scripture might be fulfilled: "Not one of his bones will be broken."
So while the reason he was not understood when he uttered his prayer may have been a language issue, an acoustics issue or even a miraculous obstruction, the literary/religious purpose was to show that he was not a "victim" in the sense of being helpless to prevent his misuse but rather committed to obey God to the end and to escape his torment by a supernatural death, and thus fulfill Ps 22:
Psa 22:19 But thou, O Lord, remove not my help afar off: be ready for mine aid. Psa 22:20 Deliver my soul from the sword; my only-begotten one from the power of the dog. Psa 22:21 Save me from the lion's mouth; and regard my lowliness from the horns of the unicorns. Psa 22:22 I will declare thy name to my brethren: in the midst of the church will I sing praise to thee. Psa 22:23 Ye that fear the Lord, praise him; all ye seed of Jacob, glorify him: let all the seed of Israel fear him. Psa 22:24 For he has not despised nor been angry at the supplication of the poor; nor turned away his face from me; but Psa 22:19 But thou, O Lord, remove not my help afar off: be ready for mine aid. Psa 22:20 Deliver my soul from the sword; my only-begotten one from the power of the dog. Psa 22:21 Save me from the lion's mouth; and regard my lowliness from the horns of the unicorns. Psa 22:22 I will declare thy name to my brethren: in the midst of the church will I sing praise to thee. Psa 22:23 Ye that fear the Lord, praise him; all ye seed of Jacob, glorify him: let all the seed of Israel fear him. Psa 22:24 For he has not despised nor been angry at the supplication of the poor; nor turned away his face from me; but when I cried to him, he heard me.
Note that the Psalm specifically rejects the idea that God "turned away" from Jesus (which is the way most understand "why have you forsaken me") but "heard" (answered) his earnest Gethsemane pleas.
Note: I think that all of the quotes are from NIV unless otherwise noted except the last which is KJV. I'm uncertain because I copied this from my answer on another post, here: Why did the bystanders at the cross misunderstand Jesus in Matthew 27:46-47?
My line of reasoning is this: Jesus was both man and God. He showed some reactions as a man(his agony and his thirst) and some as God. Since God won't and can't condone sin, he didn't want to look on Jesus as Jesus took on the sins of the world to pardon us. Jesus was aware of God's thinking and reacted as a man would if his father had just turned away from him. Jesus knew God's plan, but reacted as a man. He didn't have to show agony or thirst, but he did. It was his way of showing us he was both man and God.
Contrary to popular Christian thought, the historical Jesus didn’t have any intention on being crucified. His words in Mark 15:34 is indisputable proof of this fact. You simply do not utter these words if you’re supposed die. These words from Jesus while being nailed to a cross tells us that something has went horribly wrong, and he believes that God has abandoned him to die.
Mark 15:34 (KJV)
And at the ninth hour Jesus cried with a loud voice, saying, Eloi, Eloi, lama sabachthani? which is, being interpreted, My God, my God, why hast thou forsaken me?