"So his sons did for him just as he had commanded them. For his sons carried him to the land of Canaan, and buried him in the cave of the field of Machpelah, before Mamre, which Abraham bought with the field from Ephron the Hittite as property for a burial place" (50:12,13). Then the group returned to Egypt, as Joseph had told Pharaoh he would do.
"When Joseph's brothers saw that their father was dead, they said, 'Perhaps Joseph will hate us, and may actually repay us for all the evil which we did to him.' So they sent messengers to Joseph, saying, 'Before your father died he commanded, saying, "Thus you shall say to Joseph: 'I beg you, please forgive the trespass of your brothers and their sin; for they did evil to you.'" Now, please, forgive the trespass of the servants of the God of your father.' And Joseph wept when they spoke to him. Then his brothers also went and fell down before his face, and they said, 'Behold, we are your servants'" (Gen. 50:15-18).
Joseph is about 56 years old at this time. The wrong his brothers had perpetrated against him happened nearly four decades earlier! Yet their guilt still weighed heavily upon their minds, so much so that they may have lied to Joseph out of fear (we cannot know for certain whether Jacob ever uttered such words, though it would make more sense for him to address Joseph directly about the matter). Joseph weeps at the message he received, probably feeling sorry for their needless fear and grieved that they would think he was interested in such retribution. He responds with a message of love and confidence in divine providence.
"Joseph said to them, 'Do not be afraid, for am I in the place of God? But as for you, you meant evil against me; but God meant it for good, in order to bring it about as it is this day, to save many people alive. Now therefore, do not be afraid; I will provide for you and your little ones.' And he comforted them and spoke kindly to them" (50:19-21). Why would Joseph save them only to later destroy them? Had Joseph desired to exact revenge, he could and would have done so at a much earlier opportunity--not 17 years after being reunited with them! Joseph knows that he is not the judge--Almighty God is! Joseph knew from firsthand experience that God can work all things out for good to those who love Him (cf. Rom. 8:28)! Submitting to God's will--not vengeance--is Joseph's desire, that the divine purposes could be accomplished, whether they appear initially to be good or bad.
Joseph died at 110 years of age, living over 90 of those years in Egypt. Before dying he stated - "I am dying; but God will surely visit you, and bring you out of this land to the land of which He swore to Abraham, to Isaac, and to Jacob" (50:24). Furthermore, he made the children of Israel affirm that they would carry his bones with them when they left Egypt. To facilitate this in the future, his body was embalmed and put into a coffin.