A part of the two-loop self-energy correction, the so-called P term, is evaluated numerically for the 1s state to all orders in Zα. Our calculation, combined with the previous investigation [S. Mallampalli and J. Sapirstein, Phys.Rev. A 57, 1548 (1998)], yields the total answer for the two-loop self-energy correction in H-like uranium and bismuth. As a result, the major uncertainty is eliminated from the theoretical prediction for the Lamb shift in these systems. The total value of the ground-state Lamb shift in H-like uranium is found to be 463.93(50) eV.