I didn't know Jack Sparrow was immortal.
According to a website, he is.
During the film's climatic battle with the pirates at Isla de Muerta, Sparrow swipes a cursed coin from the treasure chest, making himself immortal and able to duel Barbossa. He shoots his rival with the pistol he has carried for ten years just as Will breaks the curse, killing Barbossa.