Aims. We investigated the origin of observed astrophysical neutrinos. Methods. We propose a multi-component model for the observed diffuse neutrino flux. The model includes residual atmospheric backgrounds, a Galactic contribution (e.g., from cosmic ray interactions with gas), an extragalactic contribution from pp interactions (e.g., from starburst galaxies), and a hard extragalactic contribution from photo-hadronic interactions at the highest energies (e.g., from tidal disruption events or active galactic nuclei). Results. We demonstrate that this model can address the key problems of astrophysical neutrino data, such as the different observed spectral indices in the high-energy starting and through-going muon samples, a possible anisotropy due to Galactic events, the non-observation of point sources, and the constraint from the extragalactic diffuse gamma-ray background. Furthermore, the recently observed muon track with a reconstructed muon energy of 4.5 PeV might be interpreted as evidence for the extragalactic photo-hadronic contribution. We perform the analysis based on the observed events instead of the unfolded fluxes by computing the probability distributions for the event type and reconstructed neutrino energy. As a consequence, we give the probability of each of these astrophysical components on an event-to-event basis.