The figure breaks down into 12.04 million holders of Beijing "hukou", or household registration certificates, and 5.1 million floating population, sources with the Ministry of Public Security said at a workshop on the country's management of migrants.
According to Xinhua, Beijing municipal government announced last year it would limit its population to 18 million by 2020, but overpopulation is putting considerable pressure on the city's natural resources and environment.
Experts have warned the current population, calculated at the end of June, is already three million more than Beijing's resources can feed.
Analysts say there is little hope for an immediate slowdown in Beijing's population growth.
Migrants, especially surplus rural laborers who have taken up non-agricultural jobs in the city, have forcefully contributed to the population explosion in recent years.About 200 million migrants are working in cities across China.