Right before the film's climactic battle with the pirates at Isla de Muerta, Sparrow swipes a cursed coin from the treasure chest, making himself immortal and capable of dueling Barbossa.