A modified relativistic magnetron (RM) with TEM output mode is proposed. By setting the coupling slots at the bottom of the resonant cavities in the transmission region rather than in the interaction region, besides possessing the original RM's advantages of high power conversion efficiency and radiating the lowest order mode, the modified RM not only improves the compactness and miniaturization of the magnetic field system, which is beneficial to realize the RMs packed by a permanent magnet, but also improves the robustness of operating frequency to structural perturbations of the coupling slots, which contributes to optimize the RM performance by adjusting the coupling slot dimensions with a relatively stable operating frequency. In the three-dimensional particle-in-cell (PIC) simulation, the modified RM with a reduction of 27.2% in the weight of the coils, 35.8% in the occupied space of the coils, and 18.6% in the operating current, can output a relatively pure TEM mode, which has been demonstrated as the dominant output mode by simulation, corresponding to an output power of 495.0 MW and a power conversion efficiency of 56.4%, at the resonant frequency of 4.30 GHz. In addition, an output power of above 2 GW can also be obtained from the RM in simulations.