Some time later, two of Pharaoh's officials — the chief cupbearer and the chief baker — offended their master. Pharaoh's anger flared, and he cast them into the prison where Joseph was confined, under the charge of the captain of the guard. The captain placed them in Joseph's care, and he served them during their days of confinement.
One night, both men dreamed separate dreams, each carrying its own mystery. In the morning Joseph found them troubled.
"Why are your faces so downcast today?" he asked.
"We have dreamed," they replied, "but there is no one to interpret."
Joseph said to them, "Do not interpretations belong to God? Tell me your dreams."
The chief cupbearer spoke first:
"In my dream there was a vine before me. On the vine were three branches. It budded, blossomed, and its clusters ripened into grapes. Pharaoh's cup was in my hand; I took the grapes, pressed them into the cup, and placed it in Pharaoh's hand."
Joseph answered, "This is its meaning: The three branches are three days. Within three days Pharaoh will lift up your head and restore you to your place. You will once again put the cup into Pharaoh's hand, as you used to do. But when it goes well with you, remember me — show kindness, and mention me to Pharaoh, for I was stolen from the land of the Hebrews, and even here I have done nothing to deserve this dungeon."
Seeing the good interpretation, the chief baker also spoke:
"In my dream, three baskets of bread were on my head. In the top basket were baked goods for Pharaoh, but the birds ate them from the basket above me."
Joseph's face grew grave. "This is its meaning: The three baskets are three days. Within three days Pharaoh will lift off your head and hang you upon a tree, and the birds will eat your flesh."
On the third day — Pharaoh's birthday — he held a great feast for his officials. He lifted up the heads of the cupbearer and the baker: the cupbearer was restored to his office, placing once more the cup in Pharaoh's hand; but the baker was hanged, just as Joseph had foretold.
Yet the chief cupbearer, restored to honor, forgot Joseph.