The nonlinear evolution of magnetized Keplerian shear flows is simulated in a local, three-dimensional model, including the effects of compressibility and stratification. Supersonic flows are initially generated by the Balbus-Hawley magnetic shear instability. The resulting flows regenerate a turbulent magnetic field which, in turn, reinforces the turbulence. Thus, the system acts like a dynamo that generates its own turbulence. However, unlike usual dynamos, the magnetic energy exceeds the kinetic energy of the turbulence by a factor of 3-10. By assuming the field to be vertical on the outer (upper and lower) surfaces we do not constrain the horizontal magnetic flux. Indeed, a large-scale toroidal magnetic field is generated, mostly in the form of toroidal flux tubes with lengths comparable to the toroidal extent of the box. This large-scale field is mainly of even (i.e., quadrupolar) parity with respect to the midplane and changes direction on a timescale of ∼30 orbits, in a possibly cyclic manner. The effective Shakura-Sunyaev alpha viscosity parameter is between 0.001 and 0.005, and the contribution from the Maxwell stress is ∼3-7 times larger than the contribution from the Reynolds stress.