Meanwhile, the Midianites sold Joseph in Egypt to Potiphar, an officer of Pharaoh and the captain of the guard.