Context: We report the discovery of TOI-519 b (TIC 218795833), a transiting substellar object (R = 1.07 RJup) orbiting a faint M dwarf (V = 17.35) on a 1.26 d orbit. Brown dwarfs and massive planets orbiting M dwarfs on short-period orbits are rare, but more have already been discovered than expected from planet formation models. TOI-519 is a valuable addition into this group of unlikely systems, and adds towards our understanding of the boundaries of planet formation. Aims: We set out to determine the nature of the Transiting Exoplanet Survey Satellite (TESS ) object of interest TOI-519 b. Methods: Our analysis uses a SPOC-pipeline TESS light curve from Sector 7, multicolour transit photometry observed with MuSCAT2 and MuSCAT, and transit photometry observed with the LCOGT telescopes. We estimate the radius of the transiting object using multicolour transit modelling, and set upper limits for its mass, effective temperature, and Bond albedo using a phase curve model that includes Doppler boosting, ellipsoidal variations, thermal emission, and reflected light components. Results: TOI-519 b is a substellar object with a radius posterior median of 1.07 RJup and 5th and 95th percentiles of 0.66 and 1.20 RJup, respectively, where most of the uncertainty comes from the uncertainty in the stellar radius. The phase curve analysis sets an upper effective temperature limit of 1800 K, an upper Bond albedo limit of 0.49, and a companion mass upper limit of 14 MJup. The companion radius estimate combined with the Teff and mass limits suggests that the companion is more likely a planet than a brown dwarf, but a brown-dwarf scenario is more likely a priori given the lack of known massive planets in 1 day orbits around M dwarfs with Teff < 3800 K, and the existence of some (but few) brown dwarfs.