This paper first develops a discrete-time multi-period mean-variance portfolio selection model under the assumption that return of a risky asset depends on the states of a stochastic market with a bankruptcy state. When bankruptcy happens, the investor can only retrieve a random fraction δ of the wealth that she or he should acquire and then invests her or his retrieved money in a risk-free asset until the terminal time. Then, by dynamic programming approach and induction method, explicit closed-form expressions for the optimal strategy and efficient frontier are derived. Analysis of the optimal results is also provided. Finally, some numerical examples are presented to illustrate the effects of bankruptcy probability and fraction δ on the efficient frontier and optimal strategy. Specially, (i) our results under the mean-variance model have quite different properties compared with those under power-utility criterion, and (ii) our model generalizes the existing mean-variance portfolio selection with regime switching without bankruptcy state. Copyright © 2012 John Wiley & Sons, Ltd.