Spanish friars brought the faith to this colonial city in Mexico's central highlands. The silver barons of the 18th century built its mansions. Now comes the pickleball invasion.

It started with just a few American retirees. These days, two dozen players fill the courts at the municipal sports centre most mornings, swinging paddles at plastic balls. There are so many clubs in Mexico dedicated to the US sport that a tournament was held here last year.

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

Donald 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.

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

Central American migrants arrive in Mexico City Show all 12 1 /12 Central American migrants arrive in Mexico City Central American migrants arrive in Mexico City Jerson Suazo, left, stands with his wife Anabel Pineda next to their six-year-old son Fernando, at a shelter in the Jesus Martinez stadium, in Mexico City. Thousands of Central American migrants arrived at the stadium, still hundreds of miles away from their goal of reaching the US AP Central American migrants arrive in Mexico City Migrants rest at the Jesus Martinez 'Palillo' Stadium EPA Central American migrants arrive in Mexico City Central American migrants arrive AP Central American migrants arrive in Mexico City epa07144051 Migrants rest at the Jesus Martinez 'Palillo' Stadium, in Mexico City, Mexico, 05 November 2018. Thousands of people from the migrant caravan who are already in Mexico City await their comrades still scattered in other parts of the country, with the intention of continuing all together in their journey to the United States. EPA/MARIO GUZMAN MARIO GUZMAN EPA Central American migrants arrive in Mexico City A Central American migrant covers himself from the cold at a shelter in the Jesus Martinez stadium, in Mexico City, Monday, Nov. 5, 2018. Thousands of Central American migrants have arrived at the stadium, still hundreds of miles away from their goal of reaching the U.S. a day before midterm elections in which they unwittingly became a central issue. (AP Photo/Rodrigo Abd) Rodrigo Abd AP Central American migrants arrive in Mexico City Dauni Portillo, a four-year-old migrant girl from Honduras plays with her dolls as she rests in a makeshift camp in Mexico City Reuters Central American migrants arrive in Mexico City Migrants rest at the Jesus Martinez 'Palillo' Stadium EPA Central American migrants arrive in Mexico City Migrants queue for registration in a makeshift camp Reuters Central American migrants arrive in Mexico City Central American migrants arrive to the City Mexico, as part of a thousands-strong caravan hoping to reach the U.S., Monday, Nov. 5, 2018. A big group of Central Americans pushed on toward Mexico City from a coastal state, planning to exit a part of the country that has long been treacherous for migrants seeking to get to the United States. (AP Photo/Marco Ugarte) Marco Ugarte AP Central American migrants arrive in Mexico City A couple of Central American migrants, part of a caravan hoping to reach the U.S. dance at a shelter at the Jesus Martinez stadium, in Mexico City, Monday, Nov. 5, 2018. Thousands of Central American migrants have arrived at the stadium, still hundreds of miles away from their goal of reaching the U.S. a day before midterm elections in which they unwittingly became a central issue. (AP Photo/Marco Ugarte) Marco Ugarte AP Central American migrants arrive in Mexico City Central American migrants, part of a caravan hoping to reach the U.S. gets settled in a shelter at the Jesus Martinez stadium, in Mexico City, Monday, Nov. 5, 2018. Thousands of Central American migrants have arrived at the stadium, still hundreds of miles away from their goal of reaching the U.S. a day before midterm elections in which they unwittingly became a central issue. (AP Photo/Marco Ugarte) Marco Ugarte AP Central American migrants arrive in Mexico City Migrants rest at the Jesus Martinez 'Palillo' Stadium EPA

They are a mixed group. They are digital natives who can work just as easily from Puerto Vallarta as Palo Alto. They are US-born kids – nearly 600,000 of them – who have returned with their Mexican-born parents. And they are retirees like Mr 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.

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."

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 per cent of the city's 100,000 residents are US citizens – Mayor Luis Alberto Villareal delivers his annual State of the Municipality address in English and Spanish.

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 6pm – 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," Mr Villareal said.

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

"We have never pressured them to have their documents in order," Mr Ebrard said.

Typically, violators pay a small fine.

Mr Villereal 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 colours and spill over walls. US 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 colours: dusky rose, peach, yellow, orange.

The scenery is not 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.

"You can live here on $2,000 or $3,000 a month – and live well," Mr 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."

Trump compares US-Mexico border to Disneyland and calls end to family separations a disaster

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

"For the things you can't find," Mr Slusser said, "you just buy them off Amazon."

So many Americans live here that it is not necessary to speak Spanish. There is 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," Mr Slusser said one recent Friday at a tiny cafe. It was karaoke night.

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

The US 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.

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 US Embassy.

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

For all the images of worn-down Central Americans crossing Mexico in caravans, the vast majority of immigrants to this country – around 75 per cent – 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.

On the annual Day of the Construction Worker this month, about 20 labourers 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 Norteno band.

"Eighty per cent of our clients are foreign," said Luis Camarena, a Mexican architect working on the house. "Of that 80 per cent, 90 per cent are American.

"For them" – Camerena gestured at the labourers – "it means work."

Undocumented immigration across the US-Mexico border Show all 14 1 /14 Undocumented immigration across the US-Mexico border Undocumented immigration across the US-Mexico border Immigrant children, many of whom are separated form their parents, are housed in Texas' tent city Reuters Undocumented immigration across the US-Mexico border A two-year-old Honduran asylum seeker cries as her mother is searched and detained near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Undocumented migrants ride on the top of a freight train referred to as the beast, or La Bestia Getty Undocumented immigration across the US-Mexico border A cage inside a US Customs and Border Protection detention facility in Texas Reuters Undocumented immigration across the US-Mexico border US Border Patrol Academy All new agents must complete a months-long training course at the New Mexico facility before assuming their posts at Border Patrol stations, mostly along the US-Mexico border Getty Undocumented immigration across the US-Mexico border US-Mexico border fence A group of young men walk along the Mexican side of the US-Mexico border fence in a remote area of the Sonoran Desert Getty Undocumented immigration across the US-Mexico border US-Mexico border fence in the US Man looks through US-Mexico border fence into the US in Tijuana, Mexico Getty Undocumented immigration across the US-Mexico border US-Mexico border fence US Border Patrol agent Sal De Leon stands near a section of the US-Mexico border fence while stopping on patrol on in La Joya, Texas Getty Undocumented immigration across the US-Mexico border US Border Patrol Academy US Border Patrol instructor yells at trainees after their initial arrival to the academy Getty Undocumented immigration across the US-Mexico border Memorial service in Guatemala Families attend a memorial service for two boys who were kidnapped and killed in San Juan Sacatepequez, Guatemala. Crime drives emigration from Guatemala to the United States, as families seek refuge from the danger Getty Undocumented immigration across the US-Mexico border Arrests on the border Undocumented immigrants comfort each other after being caught by Border Patrol agents near the US-Mexico border Getty Undocumented immigration across the US-Mexico border Detention holding facility A boy from Honduras watches a movie at a detention facility run by the US Border Patrol Getty Undocumented immigration across the US-Mexico border Mexican farm workers Mexican migrant workers harvest organic parsley at Grant Family Farms in Wellington, Colorado Getty Undocumented immigration across the US-Mexico border Mexican family in Arizona A Mexican immigrant family sits in the living room of their rented home in Tuscon, Arizona. The family that Arizona's new tough immigrant law had created a climate of fear in the immigrant community. Getty

Mr Trump is not wrong about the rising numbers of migrants reaching the southern US border. But they are 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.

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 had 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 legalising 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 per cent or 15 per cent of the student body, according to Andrew Selee, head of the Migration Policy Institute in Washington.

"It's like East LA," 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 US in English," said Silvia Giorguli, a demographer and president of the College of Mexico in the capital.

Unlike the United States, Mexico has not traditionally had many immigrants. Less than 1 per cent 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.

"How do you integrate Americans?"