While the brethren of Joseph were deliberating upon his fate, seven Midianitish merchantmen passed near the pit in which he lay. They noticed that many birds were circling above it, whence they assumed that there must be water therein, and, being thirsty, they made a halt in order to refresh themselves. When they came close, they heard Joseph screaming and wailing, and they looked down into the pit and saw a youth of beautiful figure and comely appearance. They called to him, saying: "Who art thou? Who brought thee hither, and who cast thee into this pit in the wilderness?" They all joined together and dragged him up, and took him along with them when they continued on their journey. They had to pass his brethren, who called out to the Midianites: "Why have you done such a thing, to steal our slave and carry him away with you? We threw the lad into the pit, because he was disobedient. Now, then, return our slave to us." The Midianites replied: "What, this lad, you say, is your slave, your servant? More likely is it that you all are slaves unto him, for in beauty of form, in pleasant looks, and fair appearance, he excelleth you all. Why, then, will you speak lies unto us? We will not give ear unto your words, nor believe you, for we found the lad in the wilderness, in a pit, and we took him out, and we will carry him away with us on our journey." But the sons of Jacob insisted, "Restore our slave to us, lest you meet death at the edge of the sword."
Unaffrighted, the Midianites drew their weapons, and, amid war whoops, they prepared to enter into a combat with the sons of Jacob. Then Simon rose up, and with bared sword he sprang upon the Midianites, at the same time uttering a cry that made the earth reverberate. The Midianites fell down in great consternation, and he said: "I am Simon, the son of the Hebrew Jacob, who destroyed the city of Shechem alone and unaided, and together with my brethren I destroyed the cities of the Amorites. God do so and more also, if it be not true that all the Midianites, your brethren, united with all the Canaanite kings to fight with me, cannot hold out against me. Now restore the boy you took from us, else will I give your flesh unto the fowls of the air and to the beasts of the field."
The Midianites were greatly afraid of Simon, and, terrified and abashed, they spake to the sons of Jacob with little courage: "Said ye not that ye cast this lad into the pit because he was of a rebellious spirit? What, now, will ye do with an insubordinate slave? Rather sell him to us, we are ready to pay any price you desire." This speech was part of the purpose of God. He had put it into the heart of the Midianites to insist upon possessing Joseph, that he might not remain with his brethren, and be slain by them. The brethren assented, and Joseph was sold as a slave while they sat over their meal. God spake, saying: "Over a meal did ye sell your brother, and thus shall Ahasuerus sell your descendants to Haman over a meal, and because ye have sold Joseph to be a slave, therefore shall ye say year after year, Slaves were we unto Pharaoh in Egypt."
The price paid for Joseph by the Midianites was twenty pieces of silver, enough for a pair of shoes for each of his brethren. Thus "they sold the righteous for silver, and the needy for a pair of shoes." For so handsome a youth as Joseph the sum paid was too low by far, but his appearance had been greatly changed by the horrible anguish he bad endured in the pit with the snakes and the scorpions. He had lost his ruddy complexion, and he looked sallow and sickly, and the Midianites were justified in paying a small sum for him.
The merchantmen had come upon Joseph naked in the pit, for his brethren had stripped him of all his clothes. That he might not appear before men in an unseemly condition, God sent Gabriel down to him, and the angel enlarged the amulet banging from Joseph's neck until it was a garment that covered him entirely. Joseph's brethren were looking after him as he departed with the Midianites, and when they saw him with clothes upon him, they cried after them, "Give us his raiment! We sold him naked, without clothes." His owners refused to yield to their demand, but they agreed to reimburse the brethren with four pairs of shoes, and Joseph kept his garment, the same in which he was arrayed when he arrived in Egypt and was sold to Potiphar, the same in which he was locked up in prison and appeared before Pharaoh, and the same he wore when he was ruler over Egypt.
As an atonement for the twenty pieces of silver taken by his brethren in exchange for Joseph, God commanded that every first-born son shall be redeemed by the priest with an equal amount, and, also, every Israelite must pay annually to the sanctuary as much as fell to each of the brethren as his share of the price.
The brethren of Joseph bought shoes for the money, for they said: "We will not eat it, because it is the price for the blood of our brother, but we will tread upon him, for that he spake, he would have dominion over us, and we will see what will become of his dreams." And for this reason the ordinance has been commanded, that he who refuseth to raise up a name in Israel unto his brother that hath died without having a son, shall have his shoe loosed from off his foot, and his face shall be spat upon. Joseph's brethren refused to do aught to preserve his life, and therefore the Lord loosed their shoes from off their feet, for, when they went down to Egypt, the slaves of Joseph took their shoes off their feet as they entered the gates, and they prostrated themselves before Joseph as before a Pharaoh, and, as they lay prostrate, they were spat upon, and put to shame before the Egyptians.
The Midianites pursued their journey to Gilead, but they soon regretted the purchase they had made. They feared that Joseph had been stolen in the land of the Hebrews, though sold to them as a slave, and if his kinsmen should find him with them, death would be inflicted upon them for the abduction of a free man. The high-handed manner of the sons of Jacob confirmed their suspicion, that they might be capable of man theft. Their wicked deed would explain, too, why they had accepted so small a sum in exchange for Joseph. While discussing these points, they saw, coming their way, the travelling company of Ishmaelites that had been observed earlier by the sons of Jacob, and they determined to dispose of Joseph to them, that they might at least not lose the price they had paid, and might escape the danger at the same time of being made captives for the crime of kidnapping a man. And the Ishmaelites bought Joseph from the Midianites, and they paid the same price as his former owners had given for him.