In a prologue done in the style of a silent movie, pirate captain Ras Mohammed (Peter Boyle) takes two laborers and ship’s cook Dick Scratcher (Peter Sellers) onto an island to bury treasure. Tired of being abused, Scratcher murders the pirate and both the laborers before returning to the ship. Because he is the only one who knows where the treasure is buried, he declares himself captain. When the ink on Mohammed’s map mysteriously disappears, he keeps the knowledge to himself.
Fourteen years later, the ship is lost and the crew starving. They land on an island that turns out to be Ireland where they are fed at a birthday party for 14-year-old Jeremiah (Richard Willis). When Scratcher learns that the boy can see ghosts, he shanghais him, hoping that he can spot the ghost of Mohammed and thus lead them to the treasure. The ship returns to Algiers, from where it set sail many years ago. Potentate Bay of Algier (Clive Revill) wants to have the incompetent Scratcher killed, but is persuaded by Pierre (Anthony Franciosa), the mate who has actually been running the ship, to let him live until he guides them to the treasure. Scratcher tries but fails to enlist the aid of his old friend Billy Bombay (Spike Milligan), who also claims to be able to see ghosts. The ship bumbles its way back to the island. They find what seems to be the treasure, but it turns out to be a chest filled with cannon balls. Accompanied by his six brothers, Bombay also arrives looking for treasure. They attack the pirate ship, which fires the balls back at them. Only after all of the Bombay brothers except Billy are killed do they discover that the balls were made of silver, a separate treasure buried here by Bombay. Meanwhile, Pierre and Jeremiah have deduced where the real treasure is, and dig it up. When they are joined by the others, Scratcher and Bombay take to fighting, and the crew sails without them under the command of Pierre. —TVguide.com