We estimate the mass of the Milky Way ( MW ) within 21.1 kpc using the kinematics of halo globular clusters ( GCs ) determined by Gaia . The second Gaia data release ( DR2 ) contained a catalogue of absolute proper motions ( PMs ) for a set of Galactic globular clusters and satellite galaxies measured using Gaia DR2 data . We select from the catalogue only halo GCs , identifying a total of 34 GCs spanning \mathrm { 2.0 } \leq r \leq \mathrm { 21.1 } kpc , and use their 3D kinematics to estimate the anisotropy over this range to be \beta = 0.46 ^ { +0.15 } _ { -0.19 } , in good agreement , though slightly lower than , a recent estimate for a sample of halo GCs using HST PM measurements further out in the halo . We then use the Gaia kinematics to estimate the mass of the MW inside the outermost GC to be M ( < 21.1 \mathrm { kpc } ) = 0.21 ^ { +0.04 } _ { -0.03 } \times 10 ^ { 12 } \mathrm { M _ { \odot } } , which corresponds to a circular velocity at r _ { \mathrm { max } } of v _ { \mathrm { circ } } ( 21.1 \mathrm { kpc } ) = 206 ^ { +19 } _ { -16 } \mathrm { km s ^ { -1 } } . The implied virial mass is M _ { \mathrm { virial } } = 1.28 ^ { +0.97 } _ { -0.48 } \times 10 ^ { 12 } \mathrm { M _ { \odot } } . The error bars encompass the uncertainties on the anisotropy and on the density profile of the MW dark halo , and the scatter inherent in the mass estimator we use . We get improved estimates when we combine the Gaia and HST samples to provide kinematics for 46 GCs out to 39.5 kpc : \beta = 0.52 ^ { +0.11 } _ { -0.14 } , M ( < 39.5 \mathrm { kpc } ) = 0.42 ^ { +0.07 } _ { -0.06 } \times 10 ^ { 12 } \mathrm { M _ { \odot } } , and M _ { \mathrm { virial } } = 1.54 ^ { +0.75 } _ { -0.44 } \times 10 ^ { 12 } \mathrm { M _ { \odot } } . We show that these results are robust to potential substructure in the halo GC distribution . While a wide range of MW virial masses have been advocated in the literature , from below 10 ^ { 12 } M _ { \odot } to above 2 \times 10 ^ { 12 } M _ { \odot } , these new data imply that an intermediate mass is most likely .