An amplitude analysis of the B+→Ds+Ds-K+ decay is carried out to study for the first time its intermediate resonant contributions, using proton-proton collision data collected with the LHCb detector at center-of-mass energies of 7, 8, and 13 TeV. A near-threshold peaking structure, referred to as X(3960), is observed in the Ds+Ds- invariant-mass spectrum with significance greater than 12 standard deviations. The mass, width, and the quantum numbers of the structure are measured to be 3956±5±10 MeV, 43±13±8 MeV, and JPC=0++, respectively, where the first uncertainties are statistical and the second systematic. The properties of the new structure are consistent with recent theoretical predictions for a state composed of cc¯ss¯ quarks. Evidence for an additional structure is found around 4140 MeV in the Ds+Ds- invariant mass, which might be caused either by a new resonance with the 0++ assignment or by a J/ψφ↔Ds+Ds- coupled-channel effect.