A four-dimensional variational (4D-Var) data assimilation system for inverse modelling of atmospheric methane emissions is presented. The system is based on the TM5 atmospheric transport model. It can be used for assimilating large volumes of measurements, in particular satellite observations and quasi-continuous in-situ observations, and at the same time it enables the optimization of a large number of model parameters, specifically grid-scale emission rates. Furthermore, the variational method allows to estimate uncertainties in posterior emissions. Here, the system is applied to optimize monthly methane emissions over a 1-year time window on the basis of surface observations from the NOAA-ESRL network. The results are rigorously compared with an analogous inversion by Bergamaschi et al. (2007), which was based on the traditional synthesis approach. The posterior emissions as well as their uncertainties obtained in both inversions show a high degree of consistency. At the same time we illustrate the advantage of 4D-Var in reducing aggregation errors by optimizing emissions at the grid scale of the transport model. The full potential of the assimilation system is exploited in Meirink et al. (2008), who use satellite observations of column-averaged methane mixing ratios to optimize emissions at high spatial resolution, taking advantage of the zooming capability of the TM5 model.