“It was a madhouse,” said Victor Guzmán, a 67-year-old entrepreneur from Charlotte who helped pull the event together.

President Trump regularly assails the flow of migrants crossing the Mexican border into the United States. Less noticed has been the surge of people heading in the opposite direction.

AD

Mexico’s statistics institute estimated this month that the U.S.-born population in this country has reached 799,000 — a roughly fourfold increase since 1990. And that is probably an undercount. The U.S. Embassy in Mexico City estimates the real number at 1.5 million or more.

AD

They’re a mixed group. They’re digital natives who can work just as easily from Puerto Vallarta as Palo Alto. They’re U.S.-born kids — nearly 600,000 of them — who’ve returned with their Mexican-born parents. And they’re retirees like Guzmán, who settled in this city five years ago and is now basically the pickleball king of San Miguel.

If the thousands of Mexicans moving home are taken into account, the flow of migrants from the United States to Mexico is probably larger than the flow of Mexicans to the United States.

AD

The American immigrants are pouring money into local economies, renovating historic homes and changing the dynamics of Mexican classrooms.

“It’s beginning to become a very important cultural phenomenon,” Marcelo Ebrard, Mexico’s foreign minister, said in an interview. “Like the Mexican community in the United States.”

AD

And yet, he said, Mexican authorities know little about the size or needs of their largest immigrant group. He has been tasked by President Andrés Manuel López Obrador with changing that.

While the United States is deeply divided over immigration, American immigrants here have largely been welcomed. In San Miguel — where about 10 percent of the city’s 100,000 residents are U.S. citizens — Mayor Luis Alberto Villareal delivers his annual State of the Municipality address in English and Spanish.

AD

Thanksgiving is celebrated a few weeks after Mexico’s Day of the Dead. Restaurants have adopted “American timing” — serving dinner at the ungodly hour of 6 p.m. — the mayor reports.

“Despite the fact that Donald Trump insults my country every day, here we receive the entire international community, beginning with Americans, with open arms and hearts,” Villareal said.

AD

Mexican authorities say that many of the Americans are probably undocumented — typically, they’ve overstayed their six-month visas. But the government has shown little concern.

“We have never pressured them to have their documents in order,” Ebrard said.

Typically, violators pay a small fine.

AD

Villareal shrugged.

“We like people who come to work and help the economy of the city — like Mexicans do in the United States.”

San Miguel de Allende is about 170 miles northwest of Mexico City on a mile-high plateau where the sunshine coaxes bougainvillea to erupt in blazing colors and spill over walls. U.S. veterans began moving here after World War II to study at the local art institute on the GI Bill. Over the past 30 years, expatriates flooded in, enchanted by the city’s hilly cobblestone streets, soaring Gothic church, and houses painted in sunset colors: dusky rose, peach, yellow, orange.

AD

The scenery isn’t the only draw. Given the dollar’s strength against the Mexican peso, even an American getting by on Social Security and a modest pension can rent a high-ceilinged apartment, hire a maid and eat out most nights.

AD

“You can live here on $2,000 or $3,000 a month — and live well,” Guzmán said.

Technology has shrunk the distance between the countries. In the 1980s, expat author Tony Cohan would contact his daughter in New York by trekking to the “larga distancia” office, where an operator would put a call through, as he recounted in his popular memoir “On Mexican Time.”

These days, Bill Slusser, 66, from Los Angeles, does part-time marketing work for American clients without leaving his home here: “The Internet allows that to happen.”

Since NAFTA took effect, Mexico has gotten big-box outlets such as Walmart and Office Depot.

AD

“For the things you can’t find,” Slusser said, “you just buy them off Amazon.”

So many Americans live here that it’s not necessary to speak Spanish. There’s a dazzling array of activities for English-speakers: the Rotary Club, the quilters’ circle, dancing clubs, Alcoholics Anonymous. Expats run dozens of charitable groups, mentoring Mexican students, helping provide clean drinking water, serving meals to poor abuelitas.

“Because it’s a relatively small town, it’s very easy to meet people and do whatever you want to do,” Slusser said one recent Friday at a tiny cafe. It was karaoke night.

AD

“Por favor, tortilla chips!” a New York lawyer yelled.

The U.S. population in Mexico is still much smaller than the Mexican immigrant population north of the border, which is estimated at around 11 million. But quietly, Americans are putting their imprint on Mexican towns.

AD

About 35,000 Americans live in the beach resort of Puerto Vallarta (the destination for the Love Boat in the old television series). About 20,000 Americans reside near Lake Chapala, in central Mexico, according to the U.S. Embassy.

Americans are renovating homes in the historic center of Merida, the Yucatecan capital. They’re savoring Pacific Ocean views from homes on Gringo Hill in Sayulita. There are so many Americans in Mexico City’s trendy Condesa neighborhood that the guitarists who stroll outside the cafes ask for tips in English.

AD

For all the images of worn-down Central Americans crossing Mexico in caravans, the vast majority of immigrants to this country — around 75 percent — are from the United States.

Driving around San Miguel, you can see the foreigners’ influence: million-dollar homes with chefs’ kitchens and sunken tubs not far from local dwellings of battered, unpainted brick.

But there seems to be little resentment of the Americans.

AD

On the annual Day of the Construction Worker this month, about 20 laborers crowded around folding tables set up on the patio of a half-finished house in a gated community in San Miguel. Following Mexican tradition, the owners of the house treated them to a party, complete with a lunch of pork, chicken tinga, beans, tortillas and beer, and a Norteño band.

AD

“Eighty percent of our clients are foreign,” said Luis Camarena, a Mexican architect working on the house. “Of that 80 percent, 90 percent are American.

“For them” — Camarena gestured at the laborers — “it means work.”

Trump isn’t wrong about the rising numbers of migrants reaching the southern U.S. border. But they’re more likely to be Central American than Mexican.

Since 2015, census data shows, more Mexicans have returned home each year than moved to the United States. Data from 2017, the most recent year for which numbers are available, showed a net decrease of 300,000 Mexican immigrants in the United States.

AD

Some of the Mexicans heading south were deported or felt increasingly unwelcome in the United States. Others were drawn back home by improved opportunities. Mexico’s population growth has slowed as education levels have risen, reducing the local competition for jobs.

Many of the returning Mexicans brought little Americans with them.

They are children like 3-year-old Sedona Barron and her 6-year-old brother, Adero. The siblings came to San Miguel two years ago after their father, Jesús, was deported. He, too, was a stranger to this country; he’d moved to the United States with his family illegally when he was just 5. He had married an American, but a drunken-driving conviction kept him from legalizing his status.

The move from Arizona was especially hard for Adero.

“He started kindergarten in Mexico with no Spanish,” said his mother, Katerina. “He was just terrified of speaking Spanish. He felt very lost at the beginning.”

She, too, barely spoke the language.

In some towns that have traditionally sent migrants to the United States, the American-born children of returnees now make up 10 or 15 percent of the student body, according to Andrew Selee, head of the Migration Policy Institute in Washington.

“It’s like East L.A.,” he said.

In the past, when waves of Mexicans returned from the United States, they were typically men, like the guest workers known as “braceros” who were employed on American farms from the 1940s to the 1960s.

Now many of those returning are families.

“One of the biggest challenges is that Mexican schools are not ready to receive kids who began their education in the U.S. in English,” said Silvia Giorguli, a demographer and president of the College of Mexico in the capital.

Unlike the United States, Mexico hasn’t traditionally had many immigrants. Less than 1 percent of the population is foreign-born. After a decades-long wave of Mexican migration transformed the United States, she said, it is now Mexico that faces a dilemma.