A two-period, two-sector optimizing model is used to study the effects of liberalization of trade and capital movements on the real exchange rate, unemployment, and welfare. The mechanism creating unemployment is assumed to be real wage rigidity caused by wage indexation. Due to this distortion, neither free trade nor free capital mobility is in general optimal. It is shown that in the short run liberalization leads to real appreciation while in the long run the picture is not as clear especially regarding trade liberalization. If real appreciation is associated with an increase in unemployment it is optimal to protect the open sector and restrict foreign borrowing. The optimality of these policies is guided by their effects on employment, even though in general there is no necessary connection between welfare and employment. If the initial situation is very distorted liberalization may increase welfare despite the fact that unemployment increases.