Joshua son of Nun secretly sent two men as spies from Acacia Grove, saying, "Go and scout the land, especially Jericho." So they left, and they came to the house of a woman, a prostitute named Rahab, and stayed there.
References for Joshua 2:1
The king of Jericho was told, "Look, some of the Israelite men have come here tonight to investigate the land."
Then the king of Jericho sent [word] to Rahab and said, "Bring out the men who came to you and entered your house, for they came to investigate the entire land."
But the woman had taken the two men and hidden them. So she said, "Yes, the men did come to me, but I didn't know where they were from.
At nightfall, when the gate was about to close, the men went out, and I don't know where they were going. Chase after them quickly, and you can catch up with them!"
But she had taken them up to the roof and hidden them among the stalks of flax that she had arranged on the roof.
The men pursued them along the road to the fords of the Jordan, and as soon as they left to pursue them, the gate was shut.