The final portion of the Book of Genesis (Vayechi) begins 17 years after the patriarch Jacob had arrived in Egypt, and recounts how he adopted Joseph's two sons (Ephraim and Manasseh) as his own children and then summoned his other sons to hear his final words. Among other things, Jacob foretold how the Messiah would come from the line of Judah and then instructed his sons to bury him in the promised land, and not in Egypt.
After his death, Joseph and his brothers, with various dignitaries of Egypt, formed a funeral procession and returned to Canaan to bury Jacob in the Cave of Machpelah in Hebron. After the funeral, they returned to Egypt, but Joseph's brothers feared that he would now punish them for their former betrayal and threw themselves on his mercy. Joseph reassured them that they had no reason to fear him and reminded them that God had overruled their earlier intent by intending him to be a blessing to the whole world.
The portion ends with the account of the death of Joseph, who made the sons of Israel promise to take his bones with them when the LORD would bring them back to the land of Canaan (alluding to the great Exodus to come). Joseph's faith in the Jewish people's return to the Promised Land is summarized by his statement: "God will surely remember you." He died at age 110, was embalmed and placed in a coffin in Egypt, full of faith that he would be raised from the dead in the land promised to Abraham, Isaac, and Jacob.