This trend terminated in 2015 , year in which the outflow of migrants was surpassed by the inflow , which began an upward trend and reached figures of 559.3 thousand migrants into Spain in 2010 , compared to 229 thousand foreign nationals that left the country that year .