SAN DIEGO — More than 20 years had elapsed since the U.S. government estimated how many people entered the country legally and overstayed their visas. The updated numbers, finally published in January, were sobering.

The Homeland Security Department said 527,127 people who were supposed to leave the country in the 2015 fiscal year overstayed, more than the population of Atlanta. And that was only those who entered by plane or ship, not on land.

To put that in perspective, the Border Patrol made 337,117 arrests of people entering the country illegally during the same period, nearly all on the border with Mexico. More people overstayed visas than were caught crossing the border illegally.

An estimated 40 percent of the 11.4 million people in the U.S. illegally overstayed visas, a crucial but often overlooked fact in the immigration debate. That percentage may grow as India and China replace Mexico as the largest senders of immigrants to the United States. Mexicans have long entered illegally through deserts of California, Arizona and Texas but the absence of a shared border makes that route unlikely for Asians.

Overstays accounted for about 1 percent of 45 million visitors on business and tourist visas from October 2014 to September 2015, according to the long-awaited Homeland Security report. Canada occupied the top slot for overstays, followed by Mexico, Brazil, Germany and Italy. The United Kingdom, Colombia, China, India and Venezuela rounded out the top 10.

The Pew Research Center said last year that more Mexicans were leaving the United States than coming, ending one of biggest immigration waves in U.S. history. Lack of jobs for unskilled labor after the Great Recession is widely cited as a reason but border enforcement played a part.

The Border Patrol more than quintupled to 21,444 agents in 2011 from 4,028 in 1993. The U.S. erected fences along about 650 miles of border with Mexico, nearly all of it in the final years of George W. Bush’s administration. Last year, Border Patrol arrests — one gauge of illegal crossings — fell to the lowest level since 1971.

About five years ago, the busiest corridor for illegal crossings began shifting from Arizona to South Texas, where roughly two of every three apprehended are from countries other than Mexico. Large numbers of women and children from Central America turned themselves in to U.S. authorities, triggering lengthy proceedings in clogged immigration courts. Images of children crammed into Customs and Border Protection holding cells made big news in 2014.

“We weren’t chasing people. People were walking up, looking for someone in a green uniform,” said Customs and Border Protection Commissioner R. Gil Kerlikowske. “There were smugglers that would call 911 and say, ‘Hey, we got some people coming across.’ It was a border management issue, not a border security issue … Do you have health care personnel? Do you have food? Do you have clothing?”

The government has taken steps to better track overstays, but it’s a tall order without a good checkout system. Airports weren’t designed to inspect visitors when they leave. The U.S. and Canada have exchanged names of people from third countries who enter on their shared border since 2013, but Mexico generally doesn’t track who enters by land.

Congress has long pressed for biometric screening such as fingerprints, facial images or eye scans on departing visitors, but financial and logistical challenges have been enormous.

“It’s tough because we just don’t have the infrastructure,” said Jim Williams, a former Homeland Security official who oversaw efforts to introduce biometric screening from 2003 to 2006. “It’s an open door. You (should) treat it like a house. You want to let people in you trust and you also want to know if they ever left.”

Homeland Security Secretary Jeh Johnson pledged to have biometric checks on departing visitors at the busiest airports by 2018. But the ambitious target will likely fall to his successor.