Problem statement

Let n be a whole number of the form $\displaystyle n=x^2+1$ with $\displaystyle x \in Z$, and p an odd prime that divides n.

Proof: $\displaystyle p \equiv 1 \pmod 4$.

Attempt at a solution

The only relevant case is if p=3 (mod 4).

If I try to calculate mod 3, or mod 4, or mod p, I'm not getting anywhere.

Help?