In this town of 800,000, illegal immigrants beg in the middle of streets and linger along the railway tracks that clack incessantly with boxcars ferrying food and textiles. They cook over open fires under highway overpasses. They sleep by day on dirty backpacks that bulge with a life's belongings and wait for taco stands and cantinas to close at night to plead for leftovers.

While the migrants draw sympathy from those who give them the coins from their pockets, others just want them to go home. "Some people say, 'Oh the poor migrants,' but not when you have been assaulted as I have," says Blanca Estela Perez, a waitress and cook at a restaurant who says one of her employees was robbed of a week's pay last month. "I do not like them here. Not at all."

It sounds like the sentiments of an exasperated resident of Texas or Arizona on the US-Mexican border. But actually, this is Tultitlan, in central Mexico, and the migrants overrunning this industrial city of smokestacks and sweat come from Central America and beyond.

Take the Monitor quiz: Could you pass a US citizenship test?

Just as Americans want Mexicans out, Mexicans, who might be tolerant of their country as a passageway north to the United States, have no patience with the undocumented Guatemalans and Hondurans increasingly falling short of their destinations. Nor are their feelings of resentment unique. Around the world, the welcome mat for outsiders is being rolled up on a scale rarely seen in history as economies continue to struggle and worries about cultural identities rise.

In Europe, some countries have attempted to pay Africans and others to head back home, while Israelis are legislating against immigration in the name of demographic survival. Across continents, countries have closed doors on vulnerable refugees, and, in some places, nativism has reached such heights that urban residents even want their own rural migrants banished outside city limits.

Anti-immigrant sentiment, of course, has been a recurring theme throughout history. Just look at the reaction that boatloads of Irish and Italians got when they landed on America's doorstep in the 19th and 20th centuries.

Yet today the antipathy toward newcomers is more widespread, even if usually less violent. The number of people living outside their country of birth is larger than at any time in history, in part because it has never been easier to communicate and relocate. An impoverished villager in Bolivia need only flip on a television set to see opportunities awaiting him or her in Spain. The United Nations Population Division (UNDP) estimates that the world has about 200 million international migrants. If they created their own country, it would become the fifth largest in the world.

Contrary to popular perception, anti-immigrant sentiment today isn't just about rich nations shunning the mass arrival of migrants from poorer ones. It is poor nations sending their huddled masses to other poor nations. It is rich countries sending people to other rich ones. It is countries acting as transit corridors – switching stations of humanity. According to the UNDP, only about one-third of migrants move from a developing country to a developed one.

"We in the West have the tendency to feel overwhelmed when migrants arrive," says Thomas Weiss, chief of mission in Mexico City for the International Organization for Migration. "This is without understanding exactly that many developing countries are at the present facing irregular flows that are much stronger and much more difficult to be absorbed by society and by local labor markets."

Much of the resistance to outsiders stems from familiar fears: that the immigrants will take jobs, tax services, increase crime, and alter national identities. Yet if the reasons behind today's anxieties are common, the extent to which they are being expressed isn't. "We have witnessed a great deal of anti-immigrant sentiment in history," says Mark Miller, an international migration expert at the University of Delaware and coauthor of "The Age of Migration." "[But] it was not a global phenomenon to the extent that it is today. Now virtually every area of the earth is involved in significant ways in international migration."

Is today's backlash against immigrants a temporary phenomenon or the start of a more permanent do-not-enter movement? Has the world reached its maximum capacity to tolerate outsiders? Has, in other words, the notion of accepting the world's tired, its poor, its huddled masses become a quaint ideal of some era long past?

• • •

Famile Arslan knows what it's like to feel the brusque shoulder of the state. Ms. Arslan is a Dutch lawyer whose parents moved to the Netherlands from Turkey more than 30 years ago. But not long ago authorities sent her mother an order requiring her to take a language test.

Arslan says Dutch officials only dropped the demand when she complained that her mother, a naturalized citizen, should not be treated differently from a native-born Dutch person. But the incident confirmed what she calls Europe's "trauma" over immigration. "We need immigration," she says, "but the sentiment now in the European Union is that we don't want non-Western and nonwhite immigration."

Mandatory language and integration tests for immigrants and would-be immigrants have become the rule in most European countries in the past few years. But they are only one sign of a general frustration over immigration policy across the Continent.

Mainstream politicians have joined far-right populists in calling for tighter controls of legal and illegal migrants, as well as differential treatment for foreigners and naturalized citizens already living in their countries. In just the past few months:

•Swedish voters elected an anti-immigration party to parliament for the first time.

•The French president has ignited a furor by targeting Roma, or Gypsy, illegal immigrants for expulsion.

•Britain's new coalition government has put a cap on non-European immigration and most foreigners are required to have identity cards.

•The ruling party in Denmark has suggested cutting the minimum wage for immigrants to half that for Danes.

•A party that advocates a ban on Muslim immigrants is set to join the coalition government in the Netherlands.

Still, Europe is not uniformly erecting walls to keep foreigners out. Germany, for instance, is tinkering with its laws so it can attract more immigrants to fill labor gaps in industry, health care, and high-tech sectors. British government ministers are openly divided over the new immigration cap, with some warning that labor migration quotas will only slow economic recovery.

Despite recession, the Netherlands, Italy, and Spain have all implemented amnesties for categories of undocumented immigrants and asylum-seekers, with some 300,000 people getting legal status in Italy and some 100,000 in Spain last year. Even France, which has set deportation targets, annually approves petitions for work permits for some 25,000 illegal migrant workers.

While anti-immigrant sentiment ebbs and flows, it hasn't necessarily evolved into a Europewide political issue as vociferous as the current immigration debate in America.

"The first reason is that the actual number of undocumented workers relative to the population is much higher [in the US] than in most European countries," says Jonathan Chaloff, an analyst with the international migration division of the Paris-based Organization for Economic Cooperation and Development (OECD). "The second reason is that the economic downturn has made it more of an issue. In European countries with large undocumented populations, there is a relatively high employment rate among the undocumented, and no perception of competition with natives, while in the US there's a perception that the undocumented are not employed or are unfairly competing."

To secure the EU's external borders, member countries cooperate in naval patrols to interdict illegal migrants at sea and share data to prevent failed asylum-seekers from applying in more than one country. But internal borders within the 27-member EU are being steadily dismantled. According to a recent OECD study, 44 percent of migrants in Europe are now workers from other European countries.

Agreements on the free movement of labor leave governments little wiggle room for restricting the number of such immigrants or controlling the kind of jobs they take. Family reunification accounts for another 28 percent of all immigrants to Europe.

In Britain, where limiting non-European migration was a central feature of the May national elections, almost half of all the foreigners in the country are European, with newly arrived Eastern Europeans taking the brunt of public hostility.

"Immigration is a proxy issue because there is a shortage of housing, prices shot through roof, and public services are declining, so inevitably people blame immigrants for those issues," said Sunny Hundal, a British writer and commentator on immigration and race issues. "The problem is that most people want to limit EU immigration, which is the bulk of immigration, but we can't do that legally."

European governments can expel EU migrants who lose their jobs and apply for welfare in the host country. The Netherlands and Britain, among others, have erected barriers to family-reunification visas by setting the legal marriage age for foreigners at 21 rather than 18 as it is for citizens.

A government can also deport an EU migrant who is deemed a threat to public security or public health, the justification that French President Nicolas Sarkozy used this summer when he promised to deport Roma who "disturb the public order" and called their camps a source of illegal trafficking and prostitution. Critics accuse Mr. Sarkozy of stigmatizing an impoverished minority. His move to rout and deport Gypsies, Europe's largest stateless group, sparked large public demonstrations and is still drawing protests from EU leaders, French churches, and members of his own government.

Fear of lost jobs and a drain on public services remain the primary reasons for the hardening attitudes toward immigrants around the world. In South Africa, for instance, the foreigners who have flocked to this prosperous modern economy since the fall of apartheid have come to be seen as rivals for precious jobs in a country with high unemployment.

Following this summer's World Cup in Johannesburg, many foreigners took seriously the warnings of their neighbors of looming violence and fled for their home countries as soon as the games ended. A whisper campaign in the shantytowns and slums of South Africa threatened harm to any foreign migrant who remained in the country. No doubt, many foreign workers recalled the newspaper photo of Ernesto Nhamuave, a Mozambican migrant who was stoned and burned in the slum of Reiger Park on June 14, 2008, while South African police looked on. In all, some 62 people were killed in antiforeigner riots that year.

The resentment among South Africans is rooted in the perception that foreigners are competing for houses, services, as well as coveted jobs. Unemployment in the country stands at 25 percent, and nearly half the population has no regular salary.

"It's easy to see why people would be frustrated," says Miriam Altman, director of the Human Sciences Research Council, a think tank based in Tshwane (formerly Pretoria). "Government policy is actually starting to become a bit friendlier to legal foreign migration, but attitudes among ordinary people are becoming ever more angry."

"In South Africa, you have high unemployment, high poverty rates, and people want houses, but they don't get them," says Ms. Altman. "So then they see outsiders coming in and moving next door."

South Africa may attract the bulk of Africa's economic and political migrants – estimated to be 2 million in a country with 49 million citizens – but it is not alone in having antimigrant sentiment on the continent. In Chad, resentment toward the hundreds of thousands of refugees from Darfur is so high that Amnesty International urged the UN in February 2010 to maintain peacekeeper protection for refugee camps. And as recently as last year, Ugandan citizens seemed poised to push Rwandan refugees fleeing the regime of President Paul Kagame back into Rwanda, in part because of the refugees' toll on the local economy.

Shifting demographics and a dilution of national identity represent another reason for toughening stances toward outsiders. Israel, for instance, once relied heavily on Palestinian labor as the country raced to join the developed world. But after two violence-ridden intifadas and a paradigm shift toward separation, Israel severely curtailed the number of Palestinian workers allowed into the country – and began looking abroad instead.

Today, there is a preponderance of Chinese working on building sites, Thais on farms, and Filipinos in elderly care. And as Israel has become more affluent, people from Africa, Eastern Europe, and Latin America have come seeking work. Many of them end up liking it and decide to stay, legally or illegally. They put down roots by getting married and have children who go to public schools.

For some conservative Israeli politicians, that represents a threat to the Jewish state. The Arab growth rate in Israel consistently outpaces the Jewish one. In a 2009 report, Israel's Central Bureau of Statistics estimated that the Arab population was growing at 2.6 percent, whereas the Jewish population was increasing by 1.7 percent. The fear is that economic migrants from Africa will shift the ethnic and religious mix further, making it impossible for Israel to maintain a Jewish majority.

"Israel has a legitimate fear of hundreds of thousands of Africans coming in and not being able to handle it," says Jean-Marc Lilling, a Jerusalem-based lawyer involved in immigration and asylum advocacy. "There are also security concerns about Al Qaeda infiltrating through the Sinai. The problem is that when you try to be systematic about who gets to stay and who doesn't, you fall short on the humanitarian aspect. You can't deport a child, but then every year keep bringing in thousands more people to build your houses, pick your produce, and take care of your elderly."

As part of an overall crackdown, the government of Benjamin Netanyahu decided on Aug. 1 to set guidelines for granting legal status to the children of illegal foreign workers. Under the new rules, some 800 children will be allowed to stay while another 400 will be deported. "This is a tangible threat to the Jewish and democratic character of the state of Israel; therefore, we will make a decision that is balanced between the desire to take these children into our hearts and the desire not to create an incentive for continued illegal migration that could flood the foundation of the Zionist state," Mr. Netanyahu said before the cabinet vote.

Children allowed to stay will have had to be in Israel for at least five years and speak Hebrew. That leaves Alexandra Lopez, a native of Colombia who has been living in Israel for nearly a decade, in danger of deportation. Her son is close to 4-1/2 but won't make the cut. Though Ms. Lopez has been living in Israel since she was 15, she's technically illegal as well. Israel has no naturalized citizenship.

"I feel that it's my country now. I made my life here; I got married here. We just want to be legal," Lopez explains in the modest apartment she lives in on the outskirts of Tel Aviv. "My son's future is here. He speaks Hebrew, and goes to a public kindergarten, like every other Israeli boy."

The terrorist attacks of Sept. 11, 2001, have changed the way nations think about immigration as well. Suddenly, especially in the US, border control has become a function not just of controlling populations and domestic jobs but keeping the country safe. The issues merged in Europe, too, after the terrorist attacks on a train in Madrid in 2004 and later on public transportation in Britain in 2005. "9/11 changed immigration politics, even in those kind of bellwether immigrant welcoming lands," says Mr. Miller. "There is more overt political opposition."

In the US, undocumented Mexican workers who had been pouring into Texas, California, and Arizona for decades suddenly were viewed as a national security threat. And the security argument has grown louder, especially as Americans watch the drug-trafficking violence next door that has taken nearly 30,000 lives in the past four years.

While America is divided on the immigration issue – as is virtually everywhere else on the globe – the US has garnered a reputation for being one of the most anti-immigrant countries in the world. The perception has been fanned by the high-profile controversy over a tough new enforcement law in Arizona, elements of which have now been blocked by a federal judge. Yet not everyone thinks the fortress image is warranted.

"It is a preposterous claim," says Robert Gorman, a professor at Texas State University in San Marcos. "There are huge numbers who have come to this country who have come legally and illegally. Because it has always been a country with a dynamic economy, it has always been receptive to some level of immigrant populations."

• • •

The complexity of dealing with the illegal immigration issue is evident in the complaints that come across the desk of Marco Calzada, the boyish-looking mayor of Tultitlan. Mr. Calzada is dressed smartly in a button-down shirt. He exudes the calm of a CEO. But what's happening outside his office, on the gritty streets, is far more chaotic.

An anti-immigrant sentiment is brewing here that he has little control over. Migrants, who once just passed through, are becoming increasingly tied to criminal groups. He has pleaded with the federal government to step up deportations. "They bring problems here," he says. "People ask me to get rid of them, but there is nothing I can do."

In Tultitlan, a crossroads outside Mexico City for trains arriving from the south and departing north, dozens of migrants arrive each day, mostly on freight cars that carry them, perilously, through the countryside. Residents who live near the tracks, like Ms. Perez, feel overwhelmed. She no longer lets her teenage children walk alone at night.

Officially, Mexico has shown more tolerance toward migrants of late. In 2008, the Mexican government decriminalized immigration; it no longer jails those it catches but instead just deports them. Now the country is moving toward adopting a law that allows migrants to lodge complaints and to seek medical and other care without having to prove their immigration status. It overturns a longstanding mandate that all authorities, federal or local, have to ask for migration papers when approached by foreigners and alert immigration officials of those here illegally – not unlike parts of the Arizona law that has so riled Mexicans.

Yet many advocates still think more attention needs to be paid to the safety and humanitarian needs of migrants rather than just devising ways to keep them out. Their point was punctuated in August when 72 Central and South Americans were massacred in northern Mexico, allegedly at the hands of drug traffickers, because they refused to work as recruits for the gang. The case was not an isolated one: Mexico's National Commission on Human Rights issued a report claiming that 10,000 migrants were kidnapped in a six-month period from September 2008 through February 2009.

"There is a double standard," says Manuel Angel Castillo, an immigration expert at the Colegio de Mexico in Mexico City. "We have no strong policy to detect and sanction those responsible for violations against migrants."

At the Casa del Migrante, an immigration center constructed last year near the tracks in Tultitlan, almost all of those passing through have grim stories to tell. Juan Palacios, from Nicaragua, says he had planned to reach US soil, but after one of his friends was kidnapped as he waited for a train, he lost his nerve to continue on. "I did not know how dangerous the journey was," says Mr. Palacios. "For now, I prefer to stay in Mexico."

Brenda Sevilla, a Honduran migrant attempting a journey to Houston, says she and her older sister were approached by federal police as they entered a Mexico City bus station. To hide their identities, they used Mexican slang but it didn't work. The officials demanded money or threatened to turn them in to immigration officials. They took off with all their cash – $100 – and Ms. Sevilla's earrings.

"Between getting caught in the US or Mexico, the US is way better," she says. "In the US, they deport you. In Mexico, they rob you or kidnap you."

Despite the horrors migrants face passing through Mexico, one thing that distinguishes today's cycle of anti-immigrant sentiment from many previous ones is the lack of violence. While there are major exceptions – such as the 2008 riots in South Africa – the kinds of overt assaults of the past are largely absent.

"You could look at European politics and make a good argument that there has been an anti-immigrant rightward shift almost across the board," says Miller. "Very few of them are now not characterized by an anti-immigrant party. But then you have to think about it; the anti-immigrant politics is much less violent and radical today. States don't treat them with the same brutality."

And that might be because governments understand that migrants are coming, no matter what. Even in the wake of the global economic downturn, immigrants continue to journey across borders, undaunted. Mexicans aren't returning home in large numbers from the US. Albanians continue to seek jobs in the EU. Thais are plowing farms in Israel.

"The fundamental process will not stop and go away," Miller says. "It will endure."

• Staff writer Scott Baldauf in Johannesburg, South Africa, and contributors Ilene R. Prusher in Jerusalem and Susan Sachs in Paris contributed to this report.

IN PICTURES: A haven for migrants in Mexico