Experiments with relativistic plasmas obtained and confined in a magnetic mirror under gyromagnetic autoresonance and their computer simulations are described. Plasma bunches with relativistic electrons are generated. The averaged energy of the electrons in the bunch is about few hundreds keV depending on the parameters of seed plasma, microwave electric field strength, and the rate of the pulse magnetic field increase. Varying the values of these parameters, it is possible to control the bunches.