  Let L\subset V=\bR^{k,l} be a maximally isotropic subspace. It is shown that
any simply connected Lie group with a bi-invariant flat pseudo-Riemannian
metric of signature (k,l) is 2-step nilpotent and is defined by an element \eta
\in \Lambda^3L\subset \Lambda^3V. If \eta is of type (3,0)+(0,3) with respect
to a skew-symmetric endomorphism J with J^2=\e Id, then the Lie group {\cal
L}(\eta) is endowed with a left-invariant nearly K\"ahler structure if \e =-1
and with a left-invariant nearly para-K\"ahler structure if \e =+1. This
construction exhausts all complete simply connected flat nearly (para-)K\"ahler
manifolds. If \eta \neq 0 has rational coefficients with respect to some basis,
then {\cal L}(\eta) admits a lattice \Gamma, and the quotient \Gamma\setminus
{\cal L}(\eta) is a compact inhomogeneous nearly (para-)K\"ahler manifold. The
first non-trivial example occurs in six dimensions.
