The behavior of polyelectrolytes between charged surfaces immersed in semidilute solutions is investigated theoretically. A continuum mean field approach is used for calculating numerically concentration profiles between two electrodes held at a constant potential. A generalized contact theorem relates the intersurface forces to the concentration profiles. The numerical results show that overcompensation of the surface charges by adsorbing polyelectrolytes can lead to effective attraction between equally charged surfaces. Simple scaling arguments enable us to characterize qualitatively the intersurface interactions as a function of the fraction of charged monomers p and the salt concentration cb. In the low-salt regime, we find strong repulsion at short distances, where the polymers are depleted from the intersurface gap, followed by strong attraction when the two adsorbed layers overlap. The magnitude of this attraction scales as p1/2 and its dominant length scale is proportional to a/p1/2, where a is the monomer size. At larger distances, the two adsorbing surfaces interact via a weak electrostatic repulsion. For strong polyelectrolytes at high salt concentration, the polymer contribution to attraction at short distances scales as plcb1/2 and the length scale is proportional to κsa2/p, where κs-1 is the Debye-Hückel screening length. For weak polyelectrolytes at high salt concentration, the interaction is repulsive for all surface separations and decays exponentially with a decay length equal to κs-1. The effect of irreversible adsorption is discussed as well, and it is shown that intersurface attraction can be obtained in this case as well.