The estimated number of undocumented immigrants living in the USA reached a 12-year low in 2016, continuing a decade-long decline in which that population fell from a high of 12.2 million in 2007 to 10.7 million in 2016, according to a report released Tuesday.

Researchers from the Pew Research Center, which conducted the analysis, said economics played a major role in that fall. The Great Recession wiped out millions of jobs that attracted undocumented immigrants to the USA, while the Mexican economy steadily improved, giving Mexicans more reasons to stay in their country.

Mark Hugo Lopez, Pew’s director of global migration and demography research, said the U.S. government’s ever-expanding security presence along the southwestern border – under Democratic and Republican administrations – deterred more immigrants from trying to cross illegally. Shifting demographics in Mexico have left fewer working-age males willing to make the dangerous trek.

"Those are the main themes," Lopez said.

President Donald Trump keeps pushing his 2016 campaign pledge to complete the southern border wall to prevent illegal immigration, and he described caravans of Central American immigrants arriving at the U.S. border as an "invasion" that threatens national security.

The Pew report shows that more people from El Salvador, Guatemala and Honduras entered the USA. The share of the undocumented population from Central America increased from 12 percent in 2007 to 17 percent in 2016.

That increase has not offset the drop in the number of undocumented immigrants of Mexican descent, which fell by 1.5 million over the same time period. The population of Mexico is four times larger than that of El Salvador, Guatemala and Honduras combined, so fluctuations in Mexican immigration remain the driving force behind the overall undocumented population in the USA.

In fact, Pew concluded in 2015 that more Mexicans returned to their home country than entered the USA, a historic shift in the source of illegal immigration.

That leaves Central Americans, Asians, Africans and people from other corners of Latin America representing a bigger share of recent arrivals to the USA.

The slowdown in illegal immigration means that undocumented immigrants living in the USA are more likely to be long-term residents.

In 2000, about 38 percent of undocumented immigrants had lived in the USA for five years or less, compared with 35 percent of undocumented immigrants who had been in the country longer than 10 years. Now, 66 percent of undocumented immigrants have lived here more than 10 years, and only 18 percent have been here less than five years.

The median number of years an undocumented immigrant has lived in the USA stands at 15 years.

"The population has become more settled," Lopez said. "They've had children in the U.S., have formed family relationships."

Other findings from the report:

The majority of undocumented immigrants who arrived in the past five years are “likely” visa overstays – foreigners who enter the country legally with a visa, then stay after the visa expires.

The number of undocumented immigrants working in the USA (7.8 million) and their share of the U.S. workforce (4.8 percent) fell steadily since their high points in 2007.

Over the past decade, a dozen states saw their undocumented immigrant populations drop; three states saw an increase; and the undocumented population in all remaining states remained about the same. California lost the highest number of undocumented immigrants: 550,000. The three states that saw increases in the undocumented populations were Maryland (60,000), Massachusetts (35,000) and Louisiana (15,000).

Pew researchers based their estimates on the undocumented population on an analysis of U.S. Census Bureau data.