We show that there exists a universal mechanism of long-range soliton attraction in threedimensional solids and, therefore, of discontinuity of any commensurate-incommensurate (C-IC) phase transition. This mechanism is due to the strain dependence of the soliton self-energy and specific features of the solid-state elasticity. The role of this mechanism is studied in detail for a class of C-IC transitions where the IC modulation is one-dimensional, the anisotropy in the order parameter space is small, and the symmetry of the systems allows the existence of the Lifshitz invariant. Two other mechanisms of soliton attraction are operative here but the universal mechanism considered in this paper is found to be the most important one in some cases. Comparison with the most extensively studied C-IC transition in K2SeO4 shows that the experimentally observed thermal anomalies can be understood as a result of the smearing of the theoretically predicted discontinuous transition.