In 2007, Portugal had 10,617,575 inhabitants, of whom about 332,137 were legal immigrants. In 2015, Portugal had 10,341,330 inhabitants, of whom about 383,759 were legal migrants, making up 3.7% of the population. In 2017, Portugal had 416,682 legal residents of foreign origin, of which 203,753 identified as male, and 212,929 as female. As of 2020, 32,147 residents of foreign origin acquired Portuguese nationality, of which 17,021 were female and 15,126 were male.