  In this paper, we study the abelian complexity
$\rho_n^{ab}(\mathbf{t}^{(k)})$ of generalized Thue-Morse sequences
$\mathbf{t}^{(k)}$. We obtain the exact value of
$\rho_n^{ab}(\mathbf{t}^{(k)})$ for every integer $n\geq k$. Consequently,
$\rho_n^{ab}(\mathbf{t}^{(k)})$ is ultimately periodic with the period $k$.
Moreover, we show that the abelian complexities of a class of infinite
sequences are $k$-automatic.
