RIYADH - The population of Saudi Arabia has reached 32.2 million, 42% of whom are foreign nationals with 63% of Saudis under age 30, the country's general authority for statistics said on Wednesday.

The median age of the total population is 29, according to a 2022 census, the first in 12 years, it added in a statement.

Economy and Planning Minister Faisal Al-Ibrahim told a press conference in Riyadh that the latest census was the most comprehensive and accurate census in the kingdom's history.

"Its outputs will be a key pillar for planning and decision-making ... and supporting the investment environment in the kingdom," Al-Ibrahim said.

Saudi Arabia's very large young population highlights the challenges facing Crown Prince Mohammed bin Salman in his plans to diversify the economy away from oil and create jobs for more than 10 million Saudi nationals.

Prince Mohammed has been pouring hundreds of billions of dollars into a gigantic transformation plan, known as Vision 2030, which includes building up local industry and opening up the kingdom for tourism and business.

Annual population growth since 2010 has been 2.5% on average, the latest census data showed, with the total population jumping 34.2% since that year.

Foreign residents dropped from a peak of 14.6 millions in 2016 after the government began to impose extra fees on relatives of foreign workers. In 2020, more than 1 million foreigners left the kingdom during the COVID-19 crisis.

However, Riyadh has also eased foreign workers’ contractual restrictions, including a disputed seven-decade-old sponsorship system in hopes of attracting more talent for its economic diversification drive.

Human rights groups, including Amnesty International, have been calling on Saudi authorities and other governments in the Gulf to protect foreign workers from abuses such as violent treatment and deportation.

The IMF says the Saudi economy grew 8.7% in 2022 but projects Saudi GDP growth dwindling by more than halve to 3.1% this year.

(Reporting by Aziz El Yaakoubi, Writing by Clauda Tanios; editing by Toby Chopra and Mark Heinrich)