Experts said much of last year’s drop was probably an indirect effect of President Trump’s approach to immigration policy. Congress sets most limits on immigration, but a president’s policies can also have an effect. Mr. Trump’s ban on travel from several majority-Muslim countries in 2017 has stranded thousands of immigrants abroad. He has cut the number of refugees and created new procedures that make processing visa applications more onerous.

“It’s probably no one factor,” said Randy Capps, director of United States research for the Migration Policy Institute. “It’s probably a number of small factors, a lot of which are related to policy changes and to the general effect of Trump being president.”

He added, “It’s what you would expect if it became more difficult for some immigrants to get to the U.S. and others found the country less welcoming.”

The biggest decline was among people from Latin America who were not United States citizens. The Census Bureau does not designate what portion of noncitizens are in the country illegally, but Mr. Frey said it was possible that some of the decline was among those people. In all, noncitizens declined by about 478,000 people; more than half were people from Latin America.

For many years, Mexico was the largest contributor of immigrants. But since 2010, the number of immigrants arriving from Mexico has declined, while the number coming from China and India have surged. But in 2018, the number of people from Asia who lived in the United States but were not American citizens declined. Mr. Bier said that could reflect people working or studying in the United States who had giving up on waiting for immigration status.

“The difference is so large that it’s more likely that people who are waiting or hoping for legal permanent residence felt that the arrival of the Trump administration was the writing on the wall,” he said. “That goes for people in all sorts of statuses.”

Another decline appears to be happening among students from China. The Associated Press reported this week that American universities are reporting steep declines in Chinese students, which is cutting into tuition revenue. Several universities have reported drops of one-fifth or more this fall, according to the report, which quoted university administrators blaming rising tensions between the two countries.