This section of the book is from the "Stories of Animal Sagacity" book, by William Henry Giles Kingston.
An ass was shipped at Gibraltar on board the Isis frigate, to be sent to Captain Dundas, then at Malta. The ship, on her voyage, struck on a sand-bank off Cape de Gat, when among other things thrown overboard was the poor ass; it being hoped that, although the sea was running high, the animal might reach the shore.
A few days afterwards, when the gates of Gibraltar were opened in the morning, the guard was surprised to see the ass present himself for admittance. On being allowed to pass, he went immediately to the stable of his former master. Not only had the animal swam safely to shore through the heavy surf, but, without guide or compass, had found his way from Cape de Gat to Gibraltar, a distance of more than two hundred miles, across a mountainous and intricate country, intersected by streams, and in so short a time that he could not have made one false turn.