Yosef’s (Joseph's) imprisonment finally ends when Pharaoh dreams of seven fat cows that are swallowed up by seven lean cows, and of seven fat ears of grain swallowed by seven lean ears. Yosef interprets the dreams to mean that seven years of plenty will be followed by seven years of hunger, and advises Pharaoh to store grain during the plentiful years. Pharaoh appoints Yosef governor of Egypt. Yosef marries Asenat, daughter of Potiphar, and they have two sons, Menasheh and Ephraim.
Famine spreads throughout the region, and food can be obtained only in Egypt. Ten of Yosef's brothers come to Egypt to purchase grain; the youngest, Binyomin (Benjamin), stays home, for Yaakov fears for his safety. Yosef recognizes his brothers, but they do not recognize him; he accuses them of being spies, insists that they bring Binyomin to prove that they are who they say they are, and imprisons Shimon as a hostage. Later, they discover that the money they paid for their provisions has been mysteriously returned to them.
Yaakov agrees to send Binyomin only after Yehudah assumes personal and eternal responsibility for him. This time Yosef receives them kindly, releases Shimon, and invites them to an eventful dinner at his home. But then he plants his silver goblet, purportedly imbued with magic powers, in Binyomin's sack. When the brothers set out for home the next morning they are pursued, searched, and arrested when the goblet is discovered. Yosef offers to set them free and retain only Binyomin as his slave.