Book of Jasher 39:16
And the sons of Jacob came to Gaash and they found the gates of the city locked, and about five hundred men standing at the top of the outer-most wall, and a people numerous as the sand upon the sea shore were in ambush for the sons of Jacob from without the city at the rear thereof.