  Given an undirected $n$-node unweighted graph $G = (V, E)$, a spanner with
stretch function $f(\cdot)$ is a subgraph $H\subseteq G$ such that, if two
nodes are at distance $d$ in $G$, then they are at distance at most $f(d)$ in
$H$. Spanners are very well studied in the literature. The typical goal is to
construct the sparsest possible spanner for a given stretch function.
  In this paper we study pairwise spanners, where we require to approximate the
$u$-$v$ distance only for pairs $(u,v)$ in a given set $\cP \subseteq V\times
V$. Such $\cP$-spanners were studied before [Coppersmith,Elkin'05] only in the
special case that $f(\cdot)$ is the identity function, i.e. distances between
relevant pairs must be preserved exactly (a.k.a. pairwise preservers).
  Here we present pairwise spanners which are at the same time sparser than the
best known preservers (on the same $\cP$) and of the best known spanners (with
the same $f(\cdot)$). In more detail, for arbitrary $\cP$, we show that there
exists a $\mathcal{P}$-spanner of size $O(n(|\cP|\log n)^{1/4})$ with
$f(d)=d+4\log n$. Alternatively, for any $\eps>0$, there exists a $\cP$-spanner
of size $O(n|\cP|^{1/4}\sqrt{\frac{\log n}{\eps}})$ with $f(d)=(1+\eps)d+4$. We
also consider the relevant special case that there is a critical set of nodes
$S\subseteq V$, and we wish to approximate either the distances within nodes in
$S$ or from nodes in $S$ to any other node. We show that there exists an
$(S\times S)$-spanner of size $O(n\sqrt{|S|})$ with $f(d)=d+2$, and an
$(S\times V)$-spanner of size $O(n\sqrt{|S|\log n})$ with $f(d)=d+2\log n$. All
the mentioned pairwise spanners can be constructed in polynomial time.
