Based on function approximation and genetic algorithm,three dimensional swept rotor blade optimization design was conducted on the rotors of a counter-rotating compressor. The purpose of the paper is to explore the potential of reducing the secondary flow losses and hence to improve the overall performance of the counter-rotating compressor. Two rows of swept rotor blades with the shape of S were obtained from the optimization process, and then numerical simulation was carried out to identify the effectiveness of the optimization. The results demonstrate that three dimensional swept rotor blades effectively reduce both the radial secondary flows and low velocity areas around the suction side of the two rows of swept rotor blades. Furthermore, the efficiency of the counter-rotating compressor is increased by 0.6% at the optimization point, and it is also increased at all the other operating points. The reasons accounting for the efficiency improvement lie in that three dimensional swept rotor blades create a redistribution of the radial blade loadings by transferring the blade loadings from the bottom region with high losses to the top region, and in this way the flow field is improved while maintaining the blade loadings constant.