5. Given that the complex number $z$ satisfies $|z|=1$. Then the minimum value of $\left|z^{2}-2 z+5\right|$ is $\qquad$

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
5. $\frac{8 \sqrt{5}}{5}$.

Notice that,
$$
\left|z^{2}-2 z+5\right|=|z-(1+2 \mathrm{i})||z-(1-2 \mathrm{i})| \text {. }
$$

Considering the geometric meaning, the problem is transformed into:
Given that $P$ is a moving point on the unit circle $x^{2}+y^{2}=1$, and $A(1,2), B(1,-2)$, find the maximum value of $P A \cdot P B$.
Let $P(x, y)$. Then
$$
\begin{array}{l}
P A^{2} \cdot P B^{2} \\
=\left((x-1)^{2}+(y-2)^{2}\right)\left((x-1)^{2}+(y+2)^{2}\right) \\
=\left(x^{2}+y^{2}-2 x-4 y+5\right)\left(x^{2}+y^{2}-2 x+4 y+5\right) \\
=(6-2 x-4 y)(6-2 x+4 y) \\
=(6-2 x)^{2}-16 y^{2} \\
=20 x^{2}-24 x+20 .
\end{array}
$$

Given $x \in[-1,1]$, the maximum value of $y=20 x^{2}-24 x+20$ is $\frac{64}{5}$.
Thus, the minimum value of $P A \cdot P B$ is $\frac{8 \sqrt{5}}{5}$.
Therefore, the minimum value of $\left|z^{2}-2 z+5\right|$ is $\frac{8 \sqrt{5}}{5}$.