The first amplitude analysis of the B-+/- -> pi(K+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 pi pi <-> KK S-wave rescattering. The dominant contributions in the pi(+/-) K(-/+ )and K+ K- systems are the nonresonant and the B-+/- -> rho(1450)(0)pi(+/-) 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.