# Which norm does pseudo-inverse for least square for matrix equation minimizes?

$$AX = B$$

where $A$, $X$, $B$ are general matrices with compatible dimensions. Does

$$\hat{X} := A^+ B$$

minimize $\| AX - B \|_2$ or $\| AX-B \|_F$? Or both?