Given a connected graph G of order n and diameter d, we establish a tight upper bound for the order of the automorphism group of G as a function of n and d, and determine the graphs for which the bound is attained.