Anaerobic treatment of mainstream wastewater has been proposed as a promising solution to enhance bioenergy recovery for wastewater treatment plants (WWTPs). However, the limited organics for downstream nitrogen removal and emissions of dissolved methane into the atmosphere are two major barriers to the broad application of anaerobic wastewater treatment. This study aims to develop a novel technology to overcome these two challenges by achieving simultaneous removal of dissolved methane and nitrogen, and unravel the microbial competitions underpinning the process from the microbial and kinetic perspectives. To this end, a laboratory granule-based sequencing batch reactor (GSBR) coupling anammox and nitrite/nitrate-dependent anaerobic methane oxidation (n-DAMO) microorganisms was developed to treat wastewater mimicking effluent from mainstream anaerobic treatment. The GSBR achieved high-level nitrogen and dissolved methane removal rates (> 250 mg N/L/d and > 65 mg CH4/L/d) and efficiencies (> 99% total nitrogen removal and > 90% total methane removal) during the long-term demonstration. The availability of different electron acceptors (nitrite or nitrate) imposed significant effects on the removal of ammonium and dissolved methane, as well as on the microbial communities, and the abundance and expression of functional genes. The analysis of apparent microbial kinetics showed that anammox bacteria had a higher nitrite affinity than n-DAMO bacteria, while n-DAMO bacteria had a higher methane affinity than n-DAMO archaea. These kinetics underpin the observation that nitrite is a preferred electron acceptor for removing ammonium and dissolved methane than nitrate. The findings not only extend the applications of novel n-DAMO microorganisms in nitrogen and dissolved methane removal, but also provide insights into microbial cooperation and competition in granular systems.