Recent theoretical approaches to community structure and dynamics reveal that many large-scale features of community structure (such as species-rank distributions and species-area relations) can be explained by a so-called neutral model. Using this approach, species are taken to be equivalent and trophic relations are not taken into account explicitly. Here we provide a general analytic solution to the local community model of Hubbell's neutral theory of biodiversity by recasting it as an urn model, i.e. a Markovian description of states and their transitions. Both stationary and time-dependent distributions are analysed. The stationary distribution-also called the zero-sum multinomial-is given in closed form. An approximate form for the time-dependence is obtained by using an expansion of the master equation. The temporal evolution of the approximate distribution is shown to be a good representation for the true temporal evolution for a large range of parameter values.