Potiphar was the Egyptian to whom Joseph was sold into slavery to by his jealous brothers. He was the captain of the guard in the army of Pharoah.
Though a foreigner and slave, Joseph gradually gained Potiphar's confidence and became overseer over all his possessions. Being well built and handsome, Potiphar's wife took notice of him and invited him to share her bed, an offer he spurned.
"With me in charge," he told her, "my master does not concern himself with anything in the house; everything he owns he has entrusted to my care. No one is greater in this house than I am. My master has withheld nothing from me except you, because you are his wife. How then could I do such a wicked thing and sin against God?" (Genesis 39:8-9)
Potiphar's wife continued to make advances towards Joseph, advances he kept turning down, until one day in fury she accused Joseph of attempted rape. When Potiphar heard the story he burned with anger and had Joseph cast into prison, where he remained for some years.