When the Midianites got to Egypt, they sold Joseph to a man named Potifar. Potifar was one of the king's special leaders. He was the captain of the guards that kept the king safe in the government building. The people in Egypt called their king, Pharaoh, and he was the boss for the whole country.