We present cosmological constraints from the sample of Type Ia supernovae (SNe Ia) discovered and measured during the full 5 yr of the Dark Energy Survey (DES) SN program. In contrast to most previous cosmological samples, in which SNe are classified based on their spectra, we classify the DES SNe using a machine learning algorithm applied to their light curves in four photometric bands. Spectroscopic redshifts are acquired from a dedicated follow-up survey of the host galaxies. After accounting for the likelihood of each SN being an SN Ia, we find 1635 DES SNe in the redshift range 0.10 < z < 1.13 that pass quality selection criteria sufficient to constrain cosmological parameters. This quintuples the number of high-quality z > 0.5 SNe compared to the previous leading compilation of Pantheon+ and results in the tightest cosmological constraints achieved by any SN data set to date. To derive cosmological constraints, we combine the DES SN data with a high-quality external low-redshift sample consisting of 194 SNe Ia spanning 0.025 < z < 0.10. Using SN data alone and including systematic uncertainties, we find ΩM = 0.352 ± 0.017 in flat ΛCDM. SN data alone now require acceleration (q
0 < 0 in ΛCDM) with over 5σ confidence. We find
(
Ω
M
,
w
)
=
(
0.264
−
0.096
+
0.074
,
−
0.80
−
0.16
+
0.14
)
in flat wCDM. For flat w
0
w
a
CDM, we find
(
Ω
M
,
w
0
,
w
a
)
=
(
0.495
−
0.043
+
0.033
,
−
0.36
−
0.30
+
0.36
,
−
8.8
−
4.5
+
3.7
)
, consistent with a constant equation of state to within ∼2σ. Including Planck cosmic microwave background, Sloan Digital Sky Survey baryon acoustic oscillation, and DES 3 × 2pt data gives (ΩM, w) = (0.321 ± 0.007, −0.941 ± 0.026). In all cases, dark energy is consistent with a cosmological constant to within ∼2σ. Systematic errors on cosmological parameters are subdominant compared to statistical errors; these results thus pave the way for future photometrically classified SN analyses.