Genesis 37:18-28 NIV
But they saw him in the distance, and before he reached them, they plotted to kill him.
“Here comes that dreamer!” they said to each other. “Come now, let’s kill him and throw him into one of these cisterns and say that a ferocious animal devoured him. Then we’ll see what comes of his dreams.”
When Reuben heard this, he tried to rescue him from their hands. “Let’s not take his life,” he said. “Don’t shed any blood. Throw him into this cistern here in the wilderness, but don’t lay a hand on him.” Reuben said this to rescue him from them and take him back to his father.
So when Joseph came to his brothers, they stripped him of his robe—the ornate robe he was wearing— and they took him and threw him into the cistern. The cistern was empty; there was no water in it.
As they sat down to eat their meal, they looked up and saw a caravan of Ishmaelites coming from Gilead. Their camels were loaded with spices, balm and myrrh, and they were on their way to take them down to Egypt.
Judah said to his brothers, “What will we gain if we kill our brother and cover up his blood? Come, let’s sell him to the Ishmaelites and not lay our hands on him; after all, he is our brother, our own flesh and blood.” His brothers agreed.
So when the Midianite merchants came by, his brothers pulled Joseph up out of the cistern and sold him for twenty shekels of silver to the Ishmaelites, who took him to Egypt.
NIV: New International Version