We prove that the space
K
(
X
)
K(X)
of compact operators on a Banach space
X
X
is an
M
M
-ideal in the space
L
(
X
)
L(X)
of bounded operators if and only if
X
X
has the metric compact approximation property (MCAP), and
K
(
Y
)
K(Y)
is an
M
M
-ideal in
L
(
Y
)
L(Y)
for all separable subspaces
Y
Y
of
X
X
having the MCAP. It follows that the Kalton-Werner theorem characterizing
M
M
-ideals of compact operators on separable Banach spaces is also valid for non-separable spaces: for a Banach space
X
,
K
(
X
)
X, K(X)
is an
M
M
-ideal in
L
(
X
)
L(X)
if and only if
X
X
has the MCAP, contains no subspace isomorphic to
ℓ
1
,
\ell _{1},
and has property
(
M
)
.
(M).
It also follows that
K
(
Z
,
X
)
K(Z,X)
is an
M
M
-ideal in
L
(
Z
,
X
)
L(Z,X)
for all Banach spaces
Z
Z
if and only if
X
X
has the MCAP, and
K
(
ℓ
1
,
X
)
K(\ell _{1},X)
is an
M
M
-ideal in
L
(
ℓ
1
,
X
)
L(\ell _{1},X)
.