Summary: The extreme ranks, i.e., the maximal and minimal ranks, are established for the general Hermitian solution as well as the general skew-Hermitian solution to the classical matrix equation over the quaternion algebra. Also given in this paper are the formulas of extreme ranks of real matrices , in a pair (skew-)Hermitian solution , .
Moreover, the necessary and sufficient conditions for the existence of a real (skew-)symmetric solution, a complex (skew-)Hermitian solution, and a pure imaginary (skew-)Hermitian solution to the matrix equation mentioned above are presented in this paper. Also established are expressions of such solutions to the equation when corresponding solvability conditions are satisfied. The findings of this paper widely extend the known results in the literature.