  Inspired by the work of Paterson on $C^{\ast}$-algebras of directed graphs,
we show how to associate a groupoid $\mathfrak{G}_{\mathcal{G}}$ to an
ultragraph $\mathcal{G}$ in such a way that the $C^*$-algebra of
$\mathfrak{G}_{\mathcal{G}}$ is canonically isomorphic to Tomforde's
$C^*$-algebra $C^*(\mathcal{G})$. The groupoid $\mathfrak{G}_{\mathcal{G}}$ is
built from an inverse semigroup $S_{\mathcal{G}}$ naturally associated to
$\mathcal{G}$.
