Y'hoshua the son of Nun secretly sent two spies from Sheetim with these instructions: "Go, inspect the land and Yericho." They left and came to the house of a prostitute named Rachav, where they spent the night.
The king of Yericho was told about it - "Tonight some men from Isra'el came here to reconnoiter the land."
The king of Yericho sent a message to Rachav, "Bring out the men who came to you and are staying in your house, because they have come to reconnoiter all the land."
However, the woman, after taking the two men and hiding them, replied, "Yes, the men did come to me; but I didn't know where they had come from.
The men left around the time when they shut the gate, when it was dark. Where they went I don't know; but if you chase after them quickly, you will overtake them."
Actually she had brought them up to the roof and hidden them under some stalks of flax she had spread out there.
The men pursued them all the way to the fords at the Yarden; as soon as the pursuit party had left, the gate was shut.
The two men had not yet lain down when she returned to the roof
and said to them, "I know that ADONAI has given you the land. Fear of you has fallen on us; everyone in the land is terrified at the thought of you.
We've heard how ADONAI dried up the water in the Sea of Suf ahead of you, when you left Egypt; and what you did to the two kings of the Emori on the other side of the Yarden, Sichon and 'Og, that you completely destroyed them.
As soon as we heard it, our hearts failed us. Because of you, everyone is in a state of depression. For ADONAI your God - he is God in heaven above and on the earth below.
So, please, swear to me by ADONAI that, since I have been kind to you, you will also be kind to my father's family. Give me some evidence of your good faith,
that you will spare the lives of my father, mother, brothers and sisters and all who are theirs, so that we won't be killed."
The men replied to her, "Our lives are certainly worth yours, provided you don't betray our mission. So when ADONAI gives us the land, we will treat you kindly and in good faith."
Then she lowered them by a rope through the window; since her house abutted the city wall, indeed was actually built into it.
She told them, "Head for the hills, so that the pursuit party won't get their hands on you; and hide yourselves there for three days, until the pursuers have returned. After that, you can go on your way."
The men said to her, "We will not be guilty of violating the oath you made us swear, provided that
when we enter the land, you tie this piece of scarlet cord in the window you let us down from; and you gather together in your house your father, mother, brothers, and your father's entire household.
If anyone goes out the doors of your house into the street, he will be responsible for his own blood, and we will be guiltless. But everyone who stays with you in the house - we will be responsible for his blood if anyone lays a hand on him.
However, if you say a word about this business of ours, then we will be free of your oath that you made us swear."
"According to your words, so be it," she said, and sent them away. As they departed, she tied the scarlet cord in the window.
They left, arrived in the hills, and stayed there three days, until the pursuers had returned. The pursuers had searched for them all the way but hadn't found them.
Then the two men returned. Descending from the hills they crossed over and came to Y'hoshua the son of Nun, and reported everything that had happened to them.
"Truly ADONAI has handed over all the land to us," they told Y'hoshua. "Everyone in the land is terrified that we're coming."