We build a stochastic Asset Liability Management (ALM) model for a life insurance company. Therefore, we deal with both an asset portfolio, made up of bonds, equity and cash, and a liability portfolio, comprising with-profit life insurance policies. We define a mortality model and a surrender model, as well as a new production model. First, with the purpose of ensuring the solvency of the company and the achievement of a competitive return, in the interest of both shareholders and policyholders, the insurer’s portfolio is periodically rebalanced according to the solution of a nonlinearly constrained optimization problem that aims to match asset and liability durations, subject to the attainment of a target return. In addition, several real-world constraints are imposed. When computing the company balance sheet projections, we consider not only future maturity and death payments, but also future surrender payments and all the cash flows due to new production, in order to obtain estimates that are as reliable as possible. The estimation of the timing and of the numbers of future surrenders and of future new policyholders requires the approximation of conditional expectations: To this end, we employ the least squares Monte Carlo technique. Secondly, for each bonds asset class and for equity asset class we propose a sectorial optimization problem with the aim of maximizing the expected value of a chosen utility function, subject to the results obtained from the first stage of portfolio rebalancing. Finally, we analyze a case study.