Abstract : This paper addresses the optimal scheduling of the liquidation of a portfolio using a new angle. Instead of focusing only on the scheduling aspect like Almgren and Chriss, or only on the liquidity-consuming orders like Obizhaeva and Wang, we link the optimal trade-schedule to the price of the limit orders that have to be sent to the limit order book to optimally liquidate a portfolio. Most practitioners address these two issues separately: they compute an optimal trading curve and they then send orders to the markets to try to follow it. The results obtained here solve simultaneously the two problems. As in a previous paper that solved the "intra-day market making problem", the interactions of limit orders with the market are modeled via a Poisson process pegged to a diffusive "fair price" and a Hamilton-Jacobi-Bellman equation is used to solve the problem involving both non-execution risk and price risk. Backtests are carried out to exemplify the use of our results, both on long periods of time (for the entire liquidation process) and on slices of 5 minutes (to follow a given trading curve).