Any person suffering damage done by any horses, mules, donkeys, cattle, goats, sheep, swine, or any such animals, which shall either trespass upon any land enclosed by lawful fence as provided in chapter
16.60 RCW or trespass while running at large in violation of chapter
16.24 RCW may retain and keep in custody such offending animals until the owner or person having possession of such animals shall pay such damage and costs, or until good and sufficient security be given for the same.