We construct explicit examples of globally regular static, spherically symmetric solutions in general relativity with scalar and electromagnetic fields which describe traversable wormholes (with flat and AdS asymptotics) and regular black holes, in particular, black universes. A black universe is a nonsingular black hole where, beyond the horizon, there is an expanding, asymptotically isotropic universe. The scalar field in our solutions is minimally coupled to gravity, has a nonzero self-interaction potential, while its kinetic energy is negative in a restricted strong-field region of space–time and positive outside it. Thus in such configurations a “ghost” (as are called fields with negative kinetic energy) is trapped in a small part of space, and this may in principle explain why no ghosts are observed under usual conditions. The configurations obtained contain different numbers of Killing horizons, from zero to four.