We show that special cycles generate a large part of the cohomology of
locally symmetric spaces associated to orthogonal groups. We prove in
particular that classes of totally geodesic submanifolds generate the
cohomology groups of degree $n$ of compact congruence $p$-dimensional
hyperbolic manifolds "of simple type" as long as $n$ is strictly smaller than
$\frac12 [\frac{p}{2}]$. We also prove that for connected Shimura varieties
associated to $\OO (p,2)$ the Hodge conjecture is true for classes of degree $<
1/2 [\frac{p+1}{2}]$.
We prove the local Gross-Prasad conjecture for generic L-packets of
representations of special orthogonal groups. The proof uses the same result
for tempered L-packets proved in a preceding paper, and irreducibility results
for the induced representations of whose the elements of the L-packets are
Langlands quotients.