We present measurements of the cosmic microwave background (CMB) lensing potential using the final Planck 2018 temperature and polarization data. Using polarization maps filtered to account for the noise anisotropy, we increase the significance of the detection of lensing in the polarization maps from 5σ to 9σ. Combined with temperature, lensing is detected at 40σ. We present an extensive set of tests of the robustness of the lensingpotential power spectrum, and construct a minimum-variance estimator likelihood over lensing multipoles 8 ≤ L ≤ 400 (extending the range to lower L compared to 2015), which we use to constrain cosmological parameters. We find good consistency between lensing constraints and the results from the Planck CMB power spectra within the σCDM model. Combined with baryon density and other weak priors, the lensing analysis alone constrains σ8Ω0.25m= 0.589 ± 0.020 (1σ errors). Also combining with baryon acoustic oscillation data, we find tight individual parameter constraints, σ8 = 0.811 ± 0.019, H0 = 67.9+1.2-1.3km s-1Mpc-1, and m = 0.303+0.016-0.018. Combining with Planck CMB power spectrum data, we measure σ8 to better than 1% precision, finding σ8 = 0.811 ± 0.006. CMB lensing reconstruction data are complementary to galaxy lensing data at lower redshift, having a different degeneracy direction in σ8 - m space; we find consistency with the lensing results from the Dark Energy Survey, and give combined lensing-only parameter constraints that are tighter than joint results using galaxy clustering. Using the Planck cosmic infrared background (CIB) maps as an additional tracer of high-redshift matter, we make a combined Planck-only estimate of the lensing potential over 60% of the sky with considerably more small-scale signal.We additionally demonstrate delensing of the Planck power spectra using the joint and individual lensing potential estimates, detecting a maximum removal of 40% of the lensing-induced power in all spectra. The improvement in the sharpening of the acoustic peaks by including both CIB and the quadratic lensing reconstruction is detected at high significance.