Magnetic torquers are frequently adopted as primary actuators for the attitude control of small satellites in low Earth orbit. Such actuators generate a magnetic dipole which, in turn, leads to control torques thanks to the interaction with the magnetic field of the Earth. The design of attitude control laws based on magnetic torquers is a challenging problem as the torques generated by the coils are instantaneously constrained to lie in the plane orthogonal to the local direction of the geomagnetic field vector, which varies according to the current orbital position of the spacecraft. This implies that the attitude regulation problem is formulated over a time-varying model. In this paper, the design of control laws for magnetically actuated spacecraft is considered and an approach guaranteeing robustness to parametric uncertainty and optimal performance in terms of disturbance attenuation is presented. The proposed method is based on linear time-periodic models and H∞ control theory. The results obtained by applying the proposed approach in a simulation study are also presented and discussed.