Influence of background gas and external magnetic field on the localization of particles in two dimensional yukawa systems Abstract. We investigate the simultaneous effect of a static homogeneous external magnetic field and a background gas medium on the quasi-localization of the dust particles-characterized quantitatively by cage correlation functions-in strongly coupled two-dimensional Yukawa systems. We apply the Langevin dynamics computer simulation method in which the frictional and Lorentz forces are taken into account. Both the presence of the magnetic field and the friction originating from the background gas, when acting alone, increase the caging time. When present simultaneously, however, we find that their effects combine in a non-trivial manner and act against each other within a window of the parameter values. For a fixed magnetic field, the increasing friction was found to first decrease the caging time and then to increase it beyond a certain value of the friction coefficient that depends on the magnetic field strength. A qualitative explanation was given for these observations based on the analysis of the peculiarities of the trajectories of individual particles.