Summary We consider the problem of estimating the number of species (denoted by S) of a biological community located in a region divided into n quadrats. To address this question, different hierarchical parametric approaches have been recently developed. Despite a detailed modeling of the underlying biological processes, they all have some limitations. Indeed, some assume that n is theoretically infinite; as a result, n and the sampling fraction are not a part of such models. Others require some prior information on S to be efficiently implemented. Our approach is more general in that it applies without limitation on the size of n, and it can be used in the presence, as well as in the absence, of prior information on S. Moreover, it can be viewed as an extension of the approach of Dorazio and Royle (2005, Journal of the American Statistical Association 100, 389–398) in that n is a part of the model and a prior distribution is placed on S. Despite serious computational difficulties, we have perfected an efficient Markov chain Monte Carlo algorithm, which allows us to obtain the Bayesian estimate of S. We illustrate our approach by estimating the number of species of a bird community located in a forest.