Some time later, the cupbearer and the baker of the king of Egypt offended their master, the king of Egypt.
References for Genesis 40:1
Pharaoh was angry with his two officials, the chief cupbearer and the chief baker,
References for Genesis 40:2
and put them in custody in the house of the captain of the guard, in the same prison where Joseph was confined.
References for Genesis 40:3
The captain of the guard assigned them to Joseph, and he attended them. After they had been in custody for some time,
References for Genesis 40:4
each of the two men—the cupbearer and the baker of the king of Egypt, who were being held in prison—had a dream the same night, and each dream had a meaning of its own.
References for Genesis 40:5
When Joseph came to them the next morning, he saw that they were dejected.