A search for physics beyond the standard model in the final state with two same-flavour leptons (electrons or muons) and two quarks produced in proton–proton collisions at s=13TeV is presented. The data were recorded by the CMS experiment at the CERN LHC and correspond to an integrated luminosity of 2.3fb−1. The observed data are in good agreement with the standard model background prediction. The results of the measurement are interpreted in the framework of a recently proposed model in which a heavy Majorana neutrino, Nℓ, stems from a composite-fermion scenario. Exclusion limits are set for the first time on the mass of the heavy composite Majorana neutrino, mNℓ, and the compositeness scale Λ. For the case mNℓ=Λ, the existence of Ne (Nμ) is excluded for masses up to 4.60 (4.70) TeV at 95% confidence level.