Flexible spacecrafts have been requested to perform agile and precise attitude switching maneuver recently. For this requirement, the controller of the flexible spacecrafts is required to be robust against high-frequency unmodelled uncertainty and to have high performance of motion and vibration control. In this paper, an attitude controller of the flexible spacecrafts is designed by nonstationary frequency-shaped robust control based on the differential game theory. The frequency weights of the proposed controller are designed to envelop high-frequency unmodelled uncertainty and enable the controller to suppress the spillover instability. Moreover, the frequency weights for the state vector are designed in the time domain. The proposed controller generates optimal input torques to perform agile and precise attitude switching maneuver of the spacecraft. Several simulation results show the effectiveness of the proposed controller.