The effect of an anionic surfactant, sodium dodecyl sulfate, SDS, on the properties of adsorbed layers of a cationic highly branched polyelectrolyte, polyethylene,imine, PEI, has been investigated using surface force measurements, atomic force microscopy, and ESCA. The strategy used was to preadsorb PEI on negatively charged muscovite mica surfaces from a 20 ppm polyelectrolyte solution in 10 mM NaCl. The adsorption of PEI under these conditions gives rise to a strong recharging of the surface, i.e. after adsorption of PEI the surface carries a net positive charge. This conclusion was supported by ESCA measurements. Despite the high molecular weight of PEI (1.8 x 10(5) g/mol), the adsorbed layer is found to be very flat, and a repulsive double-layer force dominates at large separations. At smaller separation a strong attractive force is the main feature. Addition of SDS to a concentration of 0.01 cmc results in a nearly complete removal of the double-layer force, an increase in compressed layer thickness, and an increase in the magnitude of the adhesion force. Hence, significant SDS incorporation in the adsorbed layer occurs already at this low surfactant concentration. A recharging of the layer occurs at higher surfactant concentrations. At 0.5 cmc, the compressed thickness of the adsorbed layer is increased significantly and the adhesion between the surfaces has disappeared. We argue that each layer now is coated with an outer SDS layer oriented with the polar groups toward solution. In fact, there are striking similarities between the interfacial association between SDS and PEI and the adsorption of an ionic surfactant to an oppositely charged mineral surface. AFM imaging reveals that the adsorbed PEI layer is somewhat nonhomogeneous and contains polyelectrolyte patches. These surface features are smoothed out by addition of SDS to a concentration of 6 mM (1 cmc in 10 mM NaCl). ESCA measurements showed that exposure of the preadsorbed PEI layer to SDS concentrations around the cmc resulted in a limited desorption; about 15% of the initially adsorbed polyelectrolyte was removed after 16 h.