5. Given that $x$ and $y$ are any real numbers, and $M$ is the maximum value of the algebraic expressions
$$
x^{2}+2 x y+y^{2} 、 x^{2}-2 x y+y^{2} 、 x^{2}+4 x+4
$$

Then the minimum value of $M$ is ( ).
(A) $\frac{1}{4}$
(B) $\frac{1}{2}$
(C) 1
(D) $\frac{3}{2}$
5. C.

From the problem, we have
$$
M \geqslant x^{2}+2 x y+y^{2} \Rightarrow \sqrt{M} \geqslant|x+y| \text{. }
$$

Similarly, $\sqrt{M} \geqslant|x-y|, \sqrt{M} \geqslant|x+2|$.
Thus, $4 \sqrt{M} \geqslant|x+y|+|x-y|+|-2 x-4| \geqslant 4$
$$
\Rightarrow \sqrt{M} \geqslant 1 \Rightarrow M \geqslant 1 \text{. }
$$

When $x=-1, y=0$, the equality holds.