  We consider a functor from the category of groups to itself $G\mapsto \mathbb
Z_\infty G$ that we call right exact $\mathbb Z$-completion of a group. It is
connected with the pronilpotent completion $\hat G$ by the short exact sequence
$1\to {\varprojlim}^1\: M_n G \to \mathbb Z_\infty G \to \hat G \to 1,$ where
$M_n G$ is $n$-th Baer invariant of $G.$ We prove that $\mathbb Z_\infty
\pi_1(X)$ is an invariant of homological equivalence of a space $X$. Moreover,
we prove an analogue of Stallings' theorem: if $G\to G'$ is a 2-connected group
homomorphism, then $\mathbb Z_\infty G\cong \mathbb Z_\infty G'.$ We give
examples of $3$-manifolds $X,Y$ such that $ \hat{\pi_1(X)}\cong \hat{\pi_1(
Y)}$ but $\mathbb Z_\infty \pi_1(X)\not \cong \mathbb Z_\infty \pi_1(Y).$ We
prove that for a finitely generated group $G$ we have $(\mathbb Z_\infty G)/
\gamma_\omega= \hat G.$ So the difference between $\hat G$ and $\mathbb
Z_\infty G$ lies in $\gamma_\omega.$ This allows us to treat $\mathbb Z_\infty
\pi_1(X)$ as a transfinite invariant of $X.$ The advantage of our approach is
that it can be used not only for $3$-manifolds but for arbitrary spaces.
