Stochastic modeling of mortality/longevity risks is necessary for internal models of (re)insurers under the new solvency regimes, such as Solvency II and the Swiss Solvency Test. In this paper, we propose a mortality model which fulfills all requirements imposed by these regimes. We show how the model can be calibrated and applied to the simultaneous modeling of both mortality and longevity risk for several populations. The main contribution of this paper is a stochastic trend component which explicitly models changes in the long-term mortality trend assumption over time. This allows to quantify mortality and longevity risk over the one-year time horizon prescribed by the solvency regimes without relying on nested simulations. We illustrate the practical ability of our model by calculating solvency capital requirements for some example portfolios, and we compare these capital requirements with those from the Solvency II standard formula.