We observed a slow relaxation of the magnetoresistance in response to an applied magneticfield in selectively doped p-GaAs–AlGaAs structures with a partially filled upper Hubbardband. We have paid special attention to excluding the effects related to temperaturefluctuations. Although these effects are important, we have found that the general featuresof slow relaxation persist. This behavior is interpreted as related to the properties of theCoulomb glass formed by charged centers with account taken of spin correlations, which aresensitive to an external magnetic field. Variation of the magnetic field changesthe numbers of the impurity complexes of different types. As a result, it affectsthe shape and depth of the polaron gap formed at the states belonging to thepercolation cluster responsible for the conductance. The suggested model explainsboth the qualitative behavior and the order of magnitude of the slowly relaxingmagnetoresistance.