This paper presents a hierarchical approach to modelling extremes of a stationary time series. The procedure comprises two stages. In the first stage, exceedances over a high threshold are modelled through a generalized Pareto distribution, which is represented as a mixture of an exponential variable with a Gamma distributed rate parameter. In the second stage, a latent Gamma process is embedded inside the exponential distribution in order to induce temporal dependence among exceedances. Unlike other hierarchical extreme-value models, this version has marginal distributions that belong to the generalized Pareto family, so that the classical extreme-value paradigm is respected. In addition, analytical developments show that different choices of the underlying Gamma process can lead to different degrees of temporal dependence of extremes, including asymptotic independence. The model is tested through a simulation study in a Markov chain setting and used for the analysis of two datasets, one environmental and one financial. In both cases, a good flexibility in capturing different types of tail behaviour is obtained.