In this paper we investigate mean-variance criterion of the optimal investment problem for an insurer. The insurer’s risk process is modeled by a Lévy process and the capital can be invested to the risky assert and the riskless assert. We obtain explicit solutions of the optimal investment strategy for the quadratic utility function by martingale approach.