Joshua attacked them by surprise after marching all night from Gilgal.