From Shittim Joshua, son of Nun, secretly sent out two men as spies. He told them, "Go, look at that country, especially the city of Jericho." So they went to Jericho and entered the house of a prostitute named Rahab to spend the night there.
The king of Jericho was told, "Some Israelites have entered the city tonight. They came to gather information about our land."
So the king of Jericho sent messengers to Rahab, who told her, "Bring out the men who came to your house. They came here to gather information about the entire land."
But the woman had already taken the two men inside and hidden them. So she said, "Yes, the men did come here. But I didn't know where they had come from.
When it was dark and the gate was just about to close, they left. I don't know where they went. If you hurry, you'll catch up with them."
(She had taken them up to the roof and covered them with the flax which she had laid up there.)
The king's men pursued them on the road leading to a shallow place to cross the Jordan River. As soon as the king's men had left, the gate was closed.
Before the spies fell asleep, Rahab went up to them on the roof.
She said to them, "I know the LORD will give you this land. Your presence terrifies us. All the people in this country are deathly afraid of you.
We've heard how the LORD dried up the water of the Red Sea in front of you when you left Egypt. We've also heard what you did to Sihon and Og, the two kings of the Amorites, who ruled east of the Jordan River. We've heard how you destroyed them for the LORD.
When we heard about it, we lost heart. There was no courage left in any of us because of you. The LORD your God is the God of heaven and earth.
Please swear by the LORD that you'll be as kind to my father's family as I've been to you. Also give me some proof
that you'll protect my father, mother, brothers, sisters, and their households, and that you'll save us from death."
The men promised her, "We pledge our lives for your lives. If you don't tell anyone what we're doing here, we'll treat you kindly and honestly when the LORD gives us this land."
So she let them down by a rope from her window since her house was built into the city wall. (She lived in the city wall.)
She told them, "Go to the mountains so that the men who are pursuing you will not find you. Hide there for three days until they return to Jericho. Then you can go on your way."
The men told her, "We will be free from the oath which you made us swear, [if you tell anyone what we're doing here].
When we invade your land, tie this red cord in the window through which you let us down. Also, gather your father, mother, brothers, and all your father's family into your house.
Whoever leaves your house will be responsible for his own life. We will be free from that responsibility. But we will take responsibility if anyone inside your house is harmed.
If you tell anyone what we're doing here, we will be free from the oath which you made us swear."
"I agree," she said. So she let them go and tied the red cord in the window.
The men went to the mountains and stayed there for three days until the king's men returned to Jericho. The king's men had searched for them all along the road but had not found them.
Then the two spies came down out of the mountains, crossed the Jordan River, and returned to Joshua, son of Nun. They told him everything that had happened to them.
They told Joshua, "The LORD has given us the whole country. The people who live there are deathly afraid of us."