The captain of the guard assigned them to Joseph, and he became their personal attendant. After they had been in custody for some time,
We should not have had this story of Pharaoh's butler and baker recorded in scripture if it had not been serviceable to Joseph's preferment. The world stands for the sake of the church, and is governed for its good. Observe, 1. Two of the great officers of Pharaoh's court, having offended the king, are committed to prison.
Commenting on Genesis 40:1-4
And the captain of the guard charged Joseph with them,.... Committed them to his care and custody, he being very probably recommended to him by the keeper of the prison for his prudence and fidelity; and if it was Potiphar, he knew his character full well, and might be now reconciled unto him, as having had a more full and clear account of the affair...
The captain of the guard charged Joseph with them--not the keeper, though he was most favorably disposed; but Potiphar himself, who, it would seem, was by this time satisfied of the perfect innocence of the young Hebrew; though, probably, to prevent the exposure of his family, he deemed it prudent to detain him in confinement (see Psa 37:5).