We construct explicit examples of globally regular static, spherically symmetric solutions in general relativity with scalar and electromagnetic fields, describing traversable wormholes with flat and AdS asymptotics and regular black holes, in particular, black universes. (A black universe is a regular black hole with an expanding, asymptotically isotropic space-time beyond the horizon.) Such objects exist in the presence of scalar fields with negative kinetic energy ("phantoms", or "ghosts"), which are not observed under usual physical conditions. To account for that, we consider what we call "trapped ghosts" (scalars whose kinetic energy is only negative in a strong-field region of space-time) and "invisible ghosts", i.e., phantom scalar fields sufficiently rapidly decaying in the weak-field region. The resulting configurations contain different numbers of Killing horizons, from zero to four.