We present a methodology to forecast mortality rates and estimate longevity and mortality risks. The methodology uses Generalized Dynamic Factor Models fitted over the differences of the log-mortality rates. We compare prediction performance with models previously proposed in the literature, such as the traditional Static Factor Model fitted over the level of log-mortality rates. We also construct risk measures by the means of vinecopulae simulations, taking into account the dependence between the idiosyncratic components of the mortality rates. The methodology is implemented to project the mortality rates of the United Kingdom, for which we consider a portfolio and study longevity and mortality risks.