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 in , or only on the liquidity-consuming orders like Obizhaeva and Wang in , 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 trade-off between execution risk and price risk. Backtests are finally carried out to exemplify the use of our results.