  Let $N\geq 1$ and $s\in (0,1)$. In the present work we characterize bounded
open sets $\Omega$ with $ C^2$ boundary (\textit{not necessarily connected})
for which the following overdetermined problem \begin{equation*} ( -\Delta)^s u
= f(u) \text{ in $\Omega$,} \qquad u=0 \text{ in $\mathbb{R}^N\setminus
\Omega$,} \qquad(\partial_{\eta})_s u=Const. \text{ on $\partial \Omega$}
\end{equation*} has a nonnegative and nontrivial solution, where $\eta $ is the
outer unit normal vectorfield along $\partial\Omega$ and for
$x_0\in\partial\Omega$ \[ \left(\partial_{\eta}\right)_{s}u(x_{0})=-\lim_{t\to
0}\frac{u(x_{0}-t\eta(x_0))}{t^s}. \]
  Under mild assumptions on $f$, we prove that $\Omega$ must be a ball. In the
special case $f\equiv 1$, we obtain an extension of Serrin's result in 1971.
The fact that $\Omega$ is not assumed to be connected is related to the
nonlocal property of the fractional Laplacian.
  The main ingredients in our proof are maximum principles and the method of
moving planes.
