  The numbers of representations of totally positive integers as sums of three
integer squares in $\mathbf{Q}(\sqrt{3})$ and in $\mathbf{Q}(\sqrt{17})$, are
studied by using Shimura lifting map of Hilbert modular forms. We show the
following results. In case of $\mathbf{Q}(\sqrt{3})$, a totally positive
integer $a+b\sqrt{3}$ is represented as a sum of three integer squares if and
only if $b$ is even. In case of $\mathbf{Q}(\sqrt{17})$, a totally positive
integer is represented as a sum of three integer squares if and only if it is
not in the form $\pi_{2}^{2e}\pi_{2}'^{2e'}\mu$ with
$\mu\equiv7\pmod{\pi_{2}^{3}}$ or $\mu\equiv7\pmod{\pi_{2}'^{3}}$ where
$\pi_{2},\pi_{2}'$ are prime elements with $2=\pi_{2}\pi_{2}'$. A similar
result as Gauss's three squares theorem in both cases of $\mathbf{Q}(\sqrt{3})$
and $\mathbf{Q}(\sqrt{17})$, and as its application, tables of class numbers of
their totally imaginary extensions are given.
