The first amplitude analysis of the B^{±}→π^{±}K^{+}K^{-} decay is reported based on a data sample corresponding to an integrated luminosity of 3.0 fb^{-1} of pp collisions recorded in 2011 and 2012 with the LHCb detector. The data are found to be best described by a coherent sum of five resonant structures plus a nonresonant component and a contribution from ππ↔KK S-wave rescattering. The dominant contributions in the π^{±} K^{∓} and K^{+} K^{-} systems are the nonresonant and the B^{±}→ρ(1450)^{0}π^{±} amplitudes, respectively, with fit fractions around 30%. For the rescattering contribution, a sizable fit fraction is observed. This component has the largest CP asymmetry reported to date for a single amplitude of (-66±4±2)%, where the first uncertainty is statistical and the second systematic. No significant CP violation is observed in the other contributions.