In the Book of Joshua, part of the Bible, the Israelites plan to attack Jericho and send in two spies. Rahab, who lives there, hides them on her roof and helps them escape.
They promise her family’s safety if she ties a red cord in her window, so the attackers will leave that house alone.
When the city falls, the story says, her family is brought out safe.