Joshua spared Rahab the prostitute and her family because she hid the men Joshua had sent to spy out Jericho. And she lives among the Israelites to this day.
In the same way, wasn't Rahab the prostitute made right by what she did when she looked after the messengers and then sent them away by a different road?
Then Joshua, son of Nun, secretly sent out two spies from Shittim. “Go and explore the land, especially around Jericho,” he told them. So they went, and stayed at the house of woman named Rahab, a prostitute. There they spent the night.
unless when we enter this land, you hang a scarlet cord in the window through which you lowered us. You must gather together in the house your father and mother and brothers—all the family.
The woman had taken the two men and had hidden them. She told the king's messengers, “Yes, it's true—the men did come to visit me, but I didn't know where they were from.
Joshua also set up twelve stones in the middle of the Jordan right where the priests carrying the Ark of the Agreement had stood, and they are still there to this very day.