FILE PHOTO: The border fence separating Spain's northern enclave Ceuta and Morocco is seen from Ceuta, Spain, June 22, 2018. REUTERS/Juan Medina/File Photo

MADRID (Reuters) - Spain’s population rose for the second straight year in 2017, after having fallen between 2012 and 2015 in the midst of an economic downturn, as an increase in foreigners offset a fall in the number of Spaniards, official data showed on Monday.

The figures come as Europe grapples with a rising influx of migrants, mostly from north Africa and war-torn countries such as Syria, after Mediterranean arrivals spiked in 2015. Sixteen EU leaders met for emergency talks in Brussels on Sunday to find a “European solution” to the issue.

The population of Spain increased to 46.66 million to Jan. 1, 2018, a rise of 132,263 people than a year earlier, the highest since Jan. 1 2013, the National Statistics Institute reported.

Spain saw a net increase of migrants arriving in the country of 146,604 people, after the arrival of almost half a million people last year, the largest migrant influx in 10 years, the data showed.

The total number of deaths in Spain in 2017 outpaced the number of births at the fastest pace since records began in 1941, data showed last week as the number of births dropped 4.5 percent while the number of deaths rose 3.2 percent.

The largest increases in migrants came from Venezuela, Colombia, Italy and Morocco, while the largest decreases were from Romania, Britain and Ecuador, INE said.