The pirates are defeated and the survivors left marooned on the island. The treasure is located in Ben Gunn's cave and is divided amongst the Dr. and the crew (including Jim). Ben helps Long John take a portion of the money and escape before Trewlaney and the rest can put him in irons. Jim supposes that the old pirate has reunited with his wife and is living a good life.