The Ishmaelites took Joseph to Egypt and sold him to Potiphar, the king's official in charge of the palace guard.