Joshua, the son of Nun, sent two spies from Shittim. He sent them in secret. He said to them, "Go. Look the land over. Most of all, check out Jericho." So they went to Jericho. They stayed at the house of a prostitute. Her name was Rahab.
References for Joshua 2:1
The king of Jericho was told, "Look! Some of the people of Israel have come here tonight. They've come to check out the land."
So the king sent a message to Rahab. It said, "Bring out the men who came into your house. They've come to check out the whole land."
But the woman had hidden the two men. She said, "It's true that the men came here. But I didn't know where they had come from.
They left at sunset, when it was time to close the city gate. I don't know which way they went. Go after them quickly. You might catch up with them."
But in fact she had taken them up on the roof. There she had hidden them under some flax she had piled up.
The king's men left to hunt down the spies. They took the road that leads to where the Jordan River can be crossed. As soon as they had gone out of the city, the gate was shut.
Rahab went up on the roof before the spies settled down for the night.
She said to them, "I know that the LORD has given this land to you. We are very much afraid of you. Everyone who lives in this country is weak with fear because of you.
"We've heard how the LORD dried up the Red Sea for you when you came out of Egypt. We've heard what you did to Sihon and Og, the two Amorite kings. They ruled east of the Jordan River. You completely destroyed them.
"When we heard about it, our hearts melted away in fear. Because of you, we aren't brave anymore. The LORD your God is the God who rules over heaven above and earth below.
"Now then, please take an oath. Promise me in the name of the LORD that you will be kind to my family. I've been kind to you. Promise me
that you will spare the lives of my father and mother. Spare my brothers and sisters. Also spare everyone in their families. Promise that you won't put any of us to death."
So the men made a promise to her. "We'll give up our lives to save yours," they said. "But don't tell anyone what we're doing. Then we'll be kind and faithful to you when the LORD gives us the land."
The house Rahab lived in was part of the city wall. So she let the spies down by a rope through the window.
She had said to them, "Go up into the hills. The men who are chasing you won't be able to find you. Hide yourselves there for three days until they return. Then you can go on your way."
The men said to her, "You made us take an oath and make a promise. But we won't keep it
unless you do what we say. When we enter the land, you must tie this bright red rope in the window. Tie it in the window you let us down through. "Bring your father and mother into your house. Also bring your brothers and everyone else in your family into your house.
None of you must go out into the street. If you do, anything that happens to you will be your own fault. Don't hold us accountable. "But if anyone hurts someone who is inside the house with you, it will be our fault. And you can hold us accountable.
"Don't tell anyone what we're doing. If you do, we won't have to keep the promise you asked us to make."
"I agree," Rahab replied. "I'll do as you say." So she sent them away, and they left. Then she tied the bright red rope in the window.
When the spies left, they went up into the hills. They stayed there for three days. By that time the men who were chasing them had searched all along the road. They couldn't find them. So they returned.
Then the two spies started back. They went down out of the hills. They went across the Jordan River. They came to Joshua, the son of Nun. They told him everything that had happened to them.
They said, "We're sure the LORD has given the whole land over to us. All of the people there are weak with fear because of us."