This paper presents a study of WWγ and WZγ triboson production using events from proton–proton collisions at a centre-of-mass energy of √s=8 TeV recorded with the ATLAS detector at the LHC and corresponding to an integrated luminosity of 20.2 fb−1. The WWγ production cross-section is determined using a final state containing an electron, a muon, a photon, and neutrinos (eνμνγ). Upper limits on the production cross-section of the eνμνγ final state and the WWγ and WZγ final states containing an electron or a muon, two jets, a photon, and a neutrino (eνjjγ or μνjjγ) are also derived. The results are compared to the cross-sections predicted by the Standard Model at next-to-leading order in the strong-coupling constant. In addition, upper limits on the production cross-sections are derived in a fiducial region optimised for a search for new physics beyond the Standard Model. The results are interpreted in the context of anomalous quartic gauge couplings using an effective field theory. Confidence intervals at 95% confidence level are derived for the 14 coupling coefficients to which WWγ and WZγ production are sensitive.