In this work, a new law for magnetic control of satellites in near-polar orbits is presented. This law has been developed for the UMPSat-2 microsatellite, which has been designed and manufactured by Universidad Politecnica de Madrid, Madrid. The control law is a modification of the B-dot strategy that enables the satellite to control the rotation rate. Besides, the satellite's equilibrium state is characterized by having the rotation axis perpendicular to the orbit's plane. The control law described in the present work only needs magnetometers and magnetorquers, as sensors and actuators, respectively, to carry out a successful attitude control on the spacecraft A description of the analysis is included. Performance and applicability of the proposed method have been demonstrated by control dynamics together with Monte Carlo techniques and by implementing the control law in the UPMSat-2 mission simulator. Results show good performance in terms of acquisition and stability of the satellite rotation rate and orientation with respect to its orbit's plane.