Meanwhile, the Midianite traders arrived in Egypt, where they sold Joseph to Potiphar, an officer of Pharaoh, the king of Egypt. Potiphar was captain of the palace guard.