During a tidal disruption event, a star is torn apart by the tidal forces of a supermassive black hole, with about 50% of the star's mass eventually accreted by the black hole. The resulting flare can, in extreme cases of super-Eddington mass accretion, result in a relativistic jet [1][2][3][4] . While tidal disruption events have been theoretically proposed as sources of high-energy cosmic rays 5,6 and neutrinos 7-14 , stacking searches indicate that their contribution to the diffuse extragalactic neutrino flux is very low 15 . However, a recent association of a track-like astrophysical neutrino (IceCube-191001A 16 ) with a tidal disruption event (AT2019dsg 17 ) indicates that some tidal disruption events can accelerate cosmic rays to petaelectronvolt energies. Here we introduce a phenomenological concordance scenario with a relativistic jet to explain this association: an expanding cocoon progressively obscures the X-rays emitted by the accretion disk, while at the same time providing a sufficiently intense external target of backscattered X-rays for the production of neutrinos via proton-photon interactions. We also reproduce the delay (relative to the peak) of the neutrino emission by scaling the production radius with the black-body radius. Our energetics and assumptions for the jet and the cocoon are compatible with expectations from numerical simulations of tidal disruption events.On 1 October 2019, a track-like astrophysical neutrino (named IceCube-191001A) was detected 16 ; a dedicated multimessenger follow-up programme revealed the tidal disruption event (TDE) AT2019dsg as a candidate source, with a P value of 0.2% to 0.5% of random association 17 , corresponding to ~3σ significance. The neutrino followed the peak of the AT2019dsg light curve by t − t peak = 154 d and had a most likely energy E ≈ 0.2 PeV (ref. 16 and links therein). Its observation reveals a new class of cosmic ray sources, as it indicates that some TDEs can accelerate cosmic rays to petaelectronvolt energies.The TDE AT2019dsg is located at redshift z ≈ 0.05, or luminosity distance d L ≈ 230 Mpc. It was discovered in the optical-ultraviolet (UV) bands by the Zwicky Transient Facility (ZTF) on 9 April 2019 18 , and it reached its luminosity peak in this band on 30 April 2019 (t peak = 58603 modified Julian date). Several follow-up observations were conducted in the optical-UV 18 , radio 17,19,20 and X-ray 17,21,22 bands, the latter starting at t − t peak = 17 d. The picture that emerged from the observations shows a several-months-long flare, with black body (BB) spectra observed in both the optical-UV (temperature T BB = 38,900 K, photospheric radius R BB ≈ 5 × 10 14 cm) and X-ray (T X ≈ 0.06 keV, R X ≈ 3 × 10 11 -7 × 10 11 cm) bands, and luminosities L exponentially decaying over an (initial) timescale of 57.5 d and 10.3 d starting at L BB = 2.88 × 10 44 erg s −1 and L X ≈ 2.5 × 10 43 erg s −1 , respectively (Fig. 1, thick black and blue curves). The quoted X-ray luminosity is for an energy window [0.3-8.0] keV, whereas an X-ray