A measurement of the WZγ triboson production cross section is presented. The analysis is based on a data sample of proton-proton collisions at a center-of-mass energy of √s =13 TeV recorded with the CMS detector at the LHC, corresponding to an integrated luminosity of 138 fb−1. The analysis focuses on the final state with three charged leptons, l±νl+l−, where l =e or μ, accompanied by an additional photon. The observed (expected) significance of the WZγ signal is 5.4 (3.8) standard deviations. The cross section is measured in a fiducial region, where events with an l originating from a tau lepton decay are excluded, to be 5.48 ±1.11 fb, which is compatible with the prediction of 3.69 ±0.24 fb at next-to-leading order in quantum chromodynamics. Exclusion limits are set on anomalous quartic gauge couplings and on the production cross sections of massive axionlike particles.