A measurement of the top quark–antiquark pair production cross section sigma _{mathrm {t}overline{mathrm {t}}} in proton–proton collisions at a centre-of-mass energy of 13,text {Te}text {V} is presented. The data correspond to an integrated luminosity of 35.9{,text {fb}^{-1}} , recorded by the CMS experiment at the CERN LHC in 2016. Dilepton events (mathrm {e}^{pm }mathrm {mu }^{{mp }}, mathrm {mu ^+}mathrm {mu ^-}, mathrm {e}^+mathrm {e}^-) are selected and the cross section is measured from a likelihood fit. For a top quark mass parameter in the simulation of m_mathrm {mathrm {t}} ^{mathrm {MC}} = 172.5 ,text {Ge}text {V} the fit yields a measured cross section sigma _{mathrm {t}overline{mathrm {t}}} = 803 pm 2 ,text {(stat)} pm 25 ,text {(syst)} pm 20 ,text {(lumi)} ,text {pb} , in agreement with the expectation from the standard model calculation at next-to-next-to-leading order. A simultaneous fit of the cross section and the top quark mass parameter in the powheg simulation is performed. The measured value of m_mathrm {mathrm {t}} ^{mathrm {MC}} = 172.33 pm 0.14 ,text {(stat)} ,^{+0.66}_{-0.72} ,text {(syst)} ,text {Ge}text {V} is in good agreement with previous measurements. The resulting cross section is used, together with the theoretical prediction, to determine the top quark mass and to extract a value of the strong coupling constant with different sets of parton distribution functions.