  The $B_K$ parameter is computed in quenched lattice QCD with Wilson twisted
mass fermions. Two variants of tmQCD are used; in both of them the relevant
$\Delta S = 2$ four-fermion operator is renormalised multiplicatively. The
renormalisation adopted is non-perturbative, with a Schroedinger functional
renormalisation condition. Renormalisation group running is also
non-perturbative, up to very high energy scales. In one of the two tmQCD
frameworks the computations have been performed at the physical $K$-meson mass,
thus eliminating the need of mass extrapolations. Simulations have been
performed at several lattice spacings and the continuum limit was reached by
combining results from both tmQCD regularisations. Finite volume effects have
been partially checked and turned out to be small. Exploratory studies have
also been performed with non-degenerate valence flavours. The final result for
the RGI bag parameter, with all sources of uncertainty (except quenching) under
control, is $\hat B_K =0.789 \pm 0.046$.
