In this note, by analyzing the behavior at infinity of the matrix symbol of an invariant operator P with respect to a fixed elliptic operator, we obtain a necessary and sufficient condition to guarantee that P is globally hypoelliptic. As an application, we obtain the characterization of global hypoellipticity on compact Lie groups and examples on the sphere and the torus. We also investigate relations between the global hypoellipticity of P and global subelliptic estimates.