6. Given that $a, b, c$ are distinct positive integers. If the set
$$
\{a+b, b+c, c+a\}=\left\{n^{2},(n+1)^{2},(n+2)^{2}\right\} \text {, }
$$

where $n \in \mathbf{Z}_{+}$. Then the minimum value of $a^{2}+b^{2}+c^{2}$ is
6. 1297 .

From $n^{2}+(n+1)^{2}+(n+2)^{2}=2(a+b+c)$ being even, we know that among $n, n+1, n+2$, there are two odd numbers and one even number, which means $n$ is odd.
Obviously, $n>1$.
Without loss of generality, let $a<b<c$.
If $n=3$, then
$$
\begin{array}{l}
a+b=9, a+c=16, b+c=25 \\
\Rightarrow a+b+c=25 .
\end{array}
$$

In this case, $a=0$, which is a contradiction.
Therefore, $n \geqslant 5$.
When $n=5$, we have
$$
\begin{array}{l}
a+b=25, a+c=36, b+c=49 \\
\Rightarrow a=6, b=19, c=30 .
\end{array}
$$

In this case, $a^{2}+b^{2}+c^{2}=1297$.