Women in science continuously face disadvantages that span across different stages of career, including limited opportunities for academic positions, shorter career longevity and lower international mobility. Previous research has suggested a trend towards more gender equality in science, but with considerable heterogeneity in pace across fields and countries. This study challenges the commonly-held view of slow but consistent progress in gender equality by assessing recent trends in representation of women in the population of published scholars using a demographic framework based on the entry, exit and migration rates of scholars, by gender. We analyzed one of the most prominent abstract and citation databases, Scopus, which includes over 33 million publications from 1996 to 2020. We estimated that the Gender Parity Index (i.e., the number of female scholars per male scholar) increased significantly, on a global scale, until around 2011. However, since then the trend towards higher representation of women has stagnated across the large majority of countries worldwide. Our projections indicate that, if current trends persist, gender gaps are likely to increase or stabilize over the next decade. We identified three demographic determinants of observed trends. First, the rate at which women enter academia has decreased relative to men; second, the rate at which women exit academia, relative to men, has been fairly stable over time; third, even within a context of enhancement of gender parity in academia, the career length of female scholars has not notably increased.