ANSWER: The last words of Jesus came when he finished the work God gave him to do. He became the perfect lamb of God that made possible the New Covenant or agreement between God and man. By willingly offering himself as the atoning sacrifice to take away the sins of the world, he made possible an eternal life of joy and happiness to ALL those who repent and obey God.
The following seven final or last words of Jesus were spoken while he hung dying on a cross. If we consider what John recorded in chapter 19 and verses 26 to 27 as a single statement, we have seven unique phrases.
The first two of his statements made from the cross come from the 23rd chapter of the book of Luke.
'Father, forgive them, for they do not know what they are doing.' (verse 34, Holy Bible in Its Original Order - A Faithful Version)
'Truly, I tell you today, you shall be with Me in paradise.' (verse 43)
The third (or fourth, depending how you count) of his final statements comes when Christ notices the apostle John standing with his mother Mary. He says the following to her.
"Woman, behold your son." 27. Then He said to the disciple (John), "Behold your mother." (John 19:26 - 27)
In regard to Bible prophecy, Luke 23:48 - 49 and Matthew 27:55 - 56 show that King David's statement that Jesus' family and friends would see his suffering from a distance was fulfilled.
10. My heart pants; my strength fails me; as for the light of my eyes, it also is gone from me. 11. My loved ones and my friends stand apart from my plague; and my neighbors stand far off (Psalm 38:10 - 11)
His fourth of seven final words is his cry, found in the book of Mark chapter 15 and verse 34, to God the Father asking why he was forsaken. He said the following, loudly, at 3pm.
'ELOI, ELOI, LAMA SABACHTHANI?' (verse 34)
'ELI, ELI, LAMA SABACHTHANI?' (verse 46)
The next two statements or 'words' made by our Savior (his fifth and sixth), as he was dying on the cross for the sins of humanity, are below. They fulfill the prophecy that Christ would be given vinegar (sour wine) to drink (Psalm 69:21). Jesus, who knew that he has successfully completed the most important part of God's great plan for man, said the following.
'I thirst.' (then after receiving vinegar to wet his lips said) "It is finished." (John 19:28, 30)
Jesus' seventh and final statement on earth also fulfilled prophecy. Raising his voice to the level where everyone could hear, he said the following according to the 23rd chapter of Luke.
"Father, into Your hands I commit My spirit." And when He had said these things, He expired. (verse 46)
King David prophesied in the 31st chapter of the book of Psalms what would be the last words of Jesus. Thank you for your question.