So it came to pass, when Joseph had come to his brothers, that they stripped Joseph of his tunic, the tunic of many colors that was on him. Then they took him and cast him into a pit. And the pit was empty; there was no water in it.
And they sat down to eat a meal. Then they lifted their eyes and looked, and there was a company of Ishmaelites, coming from Gilead with their camels, bearing spices, balm, and myrrh, on their way to carry them down to Egypt. So Judah said to his brothers, “What profit is there if we kill our brother and conceal his blood?
Come and let us sell him to the Ishmaelites, and let not our hand be upon him, for he is our brother and our flesh.” And his brothers listened. Then Midianite traders passed by; so the brothers pulled Joseph up and lifted him out of the pit and sold him to the Ishmaelites for twenty shekels of silver. And they took Joseph to Egypt.
Genesis 37:23-28 (NKJV)