In this study, we propose an advanced model-based reconstruction algorithm for three-dimensional photoacoustic imaging. The algorithm is based on accurate forward photoacoustic models and an optimization algorithm which minimizes the square of the error between the measured acoustic signals and the signals predicted by the forward models. The forward photoacoustic models incorporate system-configuration and detector-dependent factors such as frequency response and finite size effect. A conjugate gradient-based optimization algorithm is used for reconstructing images. In addition, we make use of the symmetry and locality of the photoacoustic waves in the computations of the forward photoacoustic models in order to reduce the memory requirements and computation time in three-dimensional image reconstruction. The results show that the proposed algorithm provides high-resolution and high-quality photoacoustic images.