Meanwhile, the Midianites had sold Joseph in Egypt to a man named Potiphar, who was the king's official in charge of the palace guard.