The number of Mexican immigrants in the U.S. without legal status has declined so sharply over the past decade that for the first time, they no longer make up the majority of that category, according to an estimate by the Pew Research Center Wednesday.

But the number of undocumented Central Americans is increasing — from 1.5 million in 2007 to 1.9 million in 2017, the study found.

The numbers reflect the conundrum the U.S. is facing at the southern border: The number of Central American migrants crossing the U.S.-Mexico border is rising dramatically, and they are not easily returned over the border — unlike in previous years when the majority of the border crossers were single men from Mexico.

Curbing immigration is President Donald Trump's signature political issue, but his hard-line and chaotic border policies have failed to stem the tide, and in fact, the numbers have increased since he took office.

There were about 4.9 million Mexicans in the U.S. illegally in 2017, down 2 million from 2007. The decrease was the major driver in bringing down the overall population of immigrants in the country illegally. In 2017 it was about 10.5 million — the lowest since 2004. The research group found the peak was in 2007 at about 12.2 million. Previously, Mexican nationals made up most of that population. Now, it's a combination, with Central America having the second-largest, and Asia following with 1.4 million.

Pew based the estimates on government data and used a so-called "residual" method to determine the estimate. The method is similar to those used by Homeland Security's Office of Immigration Statistics and other groups that track immigration, like the Migration Policy Institute and Center for Migration Studies.

The method uses U.S. census counts and government surveys to calculate the number of immigrants living in the U.S. in a particular year, followed by immigrant admissions and other official counts. The number of lawful immigrants is subtracted to get the estimate of immigrants here illegally. The estimate includes some 320,000 people with Temporary Protected Status, and about 700,000 beneficiaries of the Deferred Action for Childhood Arrivals, two programs ended by Trump that are on hold dude to court challenges.

Their research found that longterm residents outnumber more recent arrivals. There are also fewer people working who are not legally allowed to be in the country. Five states had increases in the number of people there without legal documentation: Louisiana, Maryland, Massachusetts, North Dakota and South Dakota.

FOLLOW NBC LATINO ON FACEBOOK, TWITTER AND INSTAGRAM.