But when He spoke those words, He had not yet died, nor rose from the dead.
Does what occurred the night before in the Upper Room provide the complete narrative?
Here is the complete narrative in theses verses.
Matthew 5:17 Think not that I am come to destroy the law, or the prophets: I am not come to destroy, but to fulfil. 18 For verily I say unto you, Till heaven and earth pass, one jot or one tittle shall in no wise pass from the law, till all be fulfilled.
John 19:28 After this, Jesus knowing that all things were now accomplished, that the scripture might be fulfilled, saith, I thirst. 29 Now there was set a vessel full of vinegar: and they filled a sponge with vinegar, and put it upon hyssop, and put it to his mouth. 30 When Jesus therefore had received the vinegar, he said, It is finished: and he bowed his head, and gave up the ghost.
What do you think gave up the ghost means after Jesus said it is finished? After knowing that all things were then accomplished within Jesus fulfilling the sacrificial part of the laws, being the last sacrifice for sin, He paid that debt in His death and resurrection.