The Midianite men who bought Joseph took him to Egypt. There was a king there who ruled the whole country. There were also many officers in charge of other people. So the men who took Joseph to Egypt sold him to an officer called Potiphar. He was in charge of the soldiers who looked after the king's palace.