A Hermitian matrix X is called a least-squares solution of the inconsistent matrix equation AXA* = B, where B is Hermitian. A* denotes the conjugate transpose of A if it minimizes the F-norm of B − AXA*; it is called a least-rank solution of AXA* = B if it minimizes the rank of B − AXA*. In this paper, we study these two types of solutions by using generalized inverses of matrices and some matrix decompositions. In particular, we derive necessary and sufficient conditions for the two types of solutions to coincide. Copyright © 2012 John Wiley & Sons, Ltd.