Keel-hauling: How did they do it?

On old-time navy and pirate ships, how did they manage keelhauling? As I understand it, the procedure was to throw the victim overboard, and pull him around the underside of the ship and bring him up on the opposite side. But obviously, when the man was thrown over the port gunwhale, there had to be a rope tied to him, which already ran down around the keel, and up over the starboard gunwhale, where presumably one of his shipmates stood ready to haul him in. So how did they get the rope around the keel before throwing the man in?
Or did such ropes routinely happen to be there already?

Cecil sez:

http://www.straightdope.com/classics/a4_239.html

One thing that isn’t clear, though, is how the looped the rope around the ship.

Sorry. Pressed submit before proofing. Should’ve said:

One thing that Cecil doesn’t make clear, though, is how they looped the rope around the ship.

There are a number of ways to loop a line under a vessel (Rope, in a Naval context, is reserved solely for articles made of wire. Everything else is ‘line’).

  • Go to the head of the vessel, pass a bight under the bowsprit, and then slack the line into the water. The vessel’s forward motion will carry the line under the keel.

  • Send a swimmer under the vessel. Keel-haulling was punishment due to the marine growth on the hull, and the fact that by dragging the victim, you force them up against said growth. A swimmer needn’t be injured, as they can control their contact.

  • Put a boat in the watter to drag a line around in front (or, less often, behind) the ship, then tighten the line and walk it to the desired position.

Keel-hauling is often mentioned in various stories and movies, but very rarely happened in real life.