Summary. Cohort studies of individuals infected with the human immunodeficiency virus (HIV) provide useful information on the past pattern of HIV diagnoses, progression of the disease and use of antiretroviral therapy. We propose a new method for using individual data from an open prevalent cohort study to estimate the incidence of HIV, by jointly modelling the HIV diagnosis, the inclusion in the cohort and the progression of the disease in a Markov model framework. The estimation procedure involves the construction of a likelihood function which takes into account the probability of observing the total number of subjects who are enrolled in the cohort and the probabilities of passage through the stages of disease for each observed subject conditionally on being included in the cohort. The estimator of the HIV infection rate is defined as the function which maximizes a penalized likelihood, and the solution of this maximization problem is approximated on a basis of cubic M-splines. The method is illustrated by using cohort data from a hospital-based surveillance system of HIV infection in Aquitaine, a region of south-western France. A simulation study is performed to study the ability of the model to reconstruct the incidence of HIV from prevalent cohort data.