Gyrotrons are a high-power source of coherent microwave radiation 1 . Their oscillation mechanism is a cyclotron-resonance maser effect, in which a fraction of the rotational kinetic energy of a mildly relativistic magnetized electron beam is converted into electromagnetic energy. The most active area of gyrotron development is their potential use for heating magnetically confined fusion plasmas to the point of thermonuclear ignition. A major obstacle to this endeavour is that during high-power millimetre-wave operation 2-9 competing modes and mode shifts seriously degrade a gyrotron's stability and efficiency 10-13 . Here, we show that these problems can be overcome by active control of the electron-beam parameters during the oscillation. In doing so, we successfully demonstrate the robust steady-state operation of a 170 GHz gyrotron producing a continuous 1 MW output power with an unprecedented efficiency of over 55% in a hard-selfexcitation region. Moreover, we find that an adjacent resonant mode previously expected to compete with and adversely affect the principal operating mode does not in fact jeopardize but rather helps this mode as a result of nonlinear effects. The result improves the outlook for using these devices for heating and instability control in future experimental fusion reactors, such as ITER [14][15][16][17][18][19] .A basic configuration of the high-power gyrotron oscillator used in the experiment 7 is shown in Supplementary Information, Figs S1,S2. The nominal operation mode is TE 31,8 , in a cylindrical open resonator, whose radius is 17.9 mm. An annular electron beam of 9.13 mm in radius is injected into the resonator along the axial magnetic field to excite TE 31,8 . The oscillation millimetre-wave power P osci is converted to a gaussian-like beam using a quasi-optical launcher 20,21 attached to the resonator, and transmitted through an edge-cooled diamond window as P out . Here, P out ∼ 0.92P osci due to the ohmic loss and the diffraction loss P loss . The collector of the gyrotron is earthed. By applying a positive voltage V d.c. to the resonator section against the collector, the energy recovery of the spent electron beam is available to enhance the overall efficiency 22 .After a demonstration of 1 h oscillation at P out = 0.6 MW with fixed parameters, the operation parameters are actively controlled with a slow timescale to investigate the oscillation characteristics in the continuous-wave state. Figure 1a shows the dependence of the output power on the magnetic field in the resonator, B c . Here, V b ∼ −72.5 kV and V d.c. ∼ 25.5 kV. After the electron-beam I b had stabilized at ∼30 A completely, which takes ∼1 min, the B c scan started from 6.72 T. The frequency is ∼170 GHz. The power increases as the B c decreases, that is, the cyclotron resonance mismatch factor Δ = (1 − (f ce /γf )) increases. Here, f and f ce are oscillation and non-relativistic cyclotron frequencies, respectively, and γ is a relativistic factor of the initial electrons. The maximum power of 0.8 MW is obtained...