In the meantime the Ishmaelites had arrived in Egypt and had sold Joseph to Potiphar. Potiphar was one of Pharaoh's officers, the captain of the guard.