We prove that the group of isometries of a metric measure space that satisfies the Riemannian curvature condition, RCD*(K, N), is a Lie group. We obtain an optimal upper bound on the dimension of this group, and classify the spaces where this maximal dimension is attained.