Hysteretic ac losses in a thin, current-carrying superconductor strip located between two flat magnetic shields of infinite permeability are calculated using Beans model of the critical state. For the shields oriented parallel to the plane of the strip, penetration of the self-induced magnetic field is enhanced, and the current dependence of the ac loss resembles that in an isolated superconductor slab, whereas for the shields oriented perpendicular to the plane of the strip, penetration of the self-induced magnetic field is impaired, and the current dependence of the ac loss is similar to that in a superconductor strip flanked by two parallel superconducting shields. Thus, hysteretic ac losses can strongly augment or, respectively, wane when the shields approach the strip.