The face of undocumented immigration to the United States has changed significantly over the past decade. For the first time in half a century, less than half of all undocumented immigrants in the country are from Mexico. In contrast, growing numbers are coming from Central America and Asia. Understanding these shifts is key to building a modern immigration system that considers who is arriving, how they are arriving, and from where.

The Pew Research Center estimates that the number of undocumented immigrants fell from an all-time high of 12.2 million in 2007 to 10.5 million as of 2017. One of the major explanations for this decline: more Mexican immigrants are leaving the United States each year than the number of those arriving. In fact, the number of undocumented Mexicans in the country fell from 6.9 million in 2007 to 4.9 million in 2017.

It isn’t just the interior of the country, either. Far fewer Mexican nationals were apprehended along the U.S.-Mexico border compared to people from other countries in the last three fiscal years, data shows. Those who were not Mexican primarily came from the Northern Triangle of Central America: El Salvador, Guatemala, and Honduras. In contrast to many Mexican migrants, who historically came here looking for work, the bulk of newer Central American arrivals are asylum-seekers fleeing gang violence and high crime rates in their home countries.

But as the number of new arrivals declines, more of those in the United States tend to be long-term residents. A full 66 percent of undocumented adults had lived here for more than ten years as of 2017, while only 20 percent had lived here for five years or less.

It’s important to keep in mind that, since 2010, most new arrivals have not been crossing the border illegally. Rather, more are over-staying the departure dates of valid visas they used to legally come to the United States. Many of the immigrants also captured in Pew’s count have temporary permission to stay in the United States but could quickly find themselves deportable. This includes those with Temporary Protected Status and Dreamers, as well as asylum claims that are awaiting a ruling.

The flip side to the declining number of undocumented immigrants is that the lawful immigrant population is growing: naturalized citizens, Lawful Permanent Residents (LPRs), and people on temporary visas. Since 2007, that number has increased by nearly a quarter (to 35.2 million). Pew estimates that, all in all, undocumented immigrants comprised 23 percent of the foreign-born population in 2017. Roughly 45 percent were naturalized citizens, 27 percent LPRs, and 5 percent temporary residents.

As Pew’s analysis reveals, undocumented flows are declining, more people are coming from Central America and Asia, and more arrive on valid visas. This suggests that our traditional notions of what undocumented migration is—and how it should be dealt with—may need to be revised.