  In this paper we analyze the structure of C*-algebras associated to
ultragraphs, which are generalizations of directed graphs. We characterize the
simple ultragraph algebras as well as deduce necessary and sufficient
conditions for an ultragraph algebra to be purely infinite and to be AF. Using
these techniques we also produce an example of an ultragraph algebra which is
neither a graph algebra nor an Exel-Laca algebra. We conclude by proving that
the C*-algebras of ultragraphs with no sinks are Cuntz-Pimsner algebras.
