Device-to-Device (D2D) communication is a promising technology that can potentially enhance the spectral and energy efficiency of cellular networks. To exploit this benefit in D2D-underlaid cellular networks, the co-channel interference between D2D and cellular users should be properly managed. In this paper, we propose a distributed power control scheme to mitigate interference in a D2D underlaid cellular system modeled as a random network using the mathematical tool of stochastic geometry. The proposed PC scheme compensates for largescale path-loss effects by employing distance-dependent pathloss parameters of the D2D link and the base station, including an estimation error margin. Closed-form expressions for the coverage probability of cellular links, D2D links, and the sum rate of D2D links are derived in terms of the allocated power, density of D2D links, and path-loss exponent. The coverage performance of both cellular and D2D users is analyzed, and the analytical results are validated through simulations. Experimental results demonstrate the efficacy and advantages of our proposed scheme over other schemes by an enhancement of 20% - 30% for the cellular and D2D coverage probabilities, and an increase in spectral efficiency by 60%.