We present and apply a method to infer the mass of the Milky Way ( MW ) by comparing the dynamics of MW satellites to those of model satellites in the eagle cosmological hydrodynamics simulations . A distribution function ( DF ) for galactic satellites is constructed from eagle using specific angular momentum and specific energy , which are scaled so as to be independent of host halo mass . In this 2-dimensional space , the orbital properties of satellite galaxies vary according to the host halo mass . The halo mass can be inferred by calculating the likelihood that the observed satellite population is drawn from this DF . Our method is robustly calibrated on mock eagle systems . We validate it by applying it to the completely independent suite of 30 auriga high-resolution simulations of MW-like galaxies : the method accurately recovers their true mass and associated uncertainties . We then apply it to ten classical satellites of the MW with 6D phase-space measurements , including updated proper motions from the Gaia satellite . The mass of the MW is estimated to be M _ { 200 } ^ { \textnormal { MW } } = 1.04 _ { -0.14 } ^ { +0.23 } \times 10 ^ { 12 } M _ { \odot } ( 68 % confidence limits ) . We combine our total mass estimate with recent mass estimates in the inner regions of the Galaxy to infer a halo concentration of c _ { 200 } ^ { \textnormal { MW } } = 12.0 ^ { +3.5 } _ { -2.3 } , which is higher than the concentration of typical \sim 10 ^ { 12 } M _ { \odot } cold dark matter haloes .