Spain's population passed 48 million in 2022 and now counts more than six million foreign nationals, whose numbers jumped last year, the National Statistics Institute (INE) said Wednesday.

The number equates to a 1.26 percent growth in the population, with an increase of almost 600,000 people within the year, an INE statement said.

Figures show that Spain's population stood at 48,085,361 inhabitants on January 1, 2023, up from 47,486,727 a year earlier, it said.

Of the overall number, 6,089,620 are foreign nationals who make up 12.7 percent of the population.

One factor driving the increase was Russia's war on Ukraine, which began in February 2022 and prompted hundreds of thousands to flee with some 83,401 Ukrainians moving to Spain that year, the figures showed.

In relative terms, that meant the number of Ukrainians in Spain increased by 76 percent in 2022.

Ukrainians made up the second-largest group of foreign nationals moving to Spain after Colombians, with 142,391 new arrivals registered that year, and 64,498 Venezuelans.

Of the foreign nationals living in Spain, the largest group are Moroccans (893,953), then Romanians (629,755) and Colombians (453,911).

The largest number of foreign nationals to leave Spain in 2022 were Romanians, whose number fell by 9,742, and UK nationals with 7,328 fewer than a year earlier.