# But the woman had taken the two men and hidden them

This happened before the king's messenger spoke to her.

# the woman

This refers to Rahab, the prostitute.