Quick: Draw yourself a mental portrait of an illegal immigrant. Who do you see? An impoverished Mexican, no doubt, dressed in jeans and a sweat-stained work shirt, his eyes downcast, his back bent over a lawn mower in suburban San Diego, a row of lettuce in the Central Valley, or an assembly line filled with chicken carcasses in a North Carolina poultry plant.

I see my cousin.

Sean (not his real name) came to Boston on a tourist visa in the mid-1980s. But he didn't spend any time walking the Freedom Trail. Instead he went looking for a steady job at a decent wage, the sort of job he couldn't find back home in chronically depressed Ireland. Eventually he found a place on a construction crew--no questions asked, no papers required--and settled into his new life. He wasn't alone. In the 1980s and early 1990s approximately 150,000 Irish men and women slipped into the United States illegally, taking jobs as laborers, waiters, bartenders, and nannies up and down the East Coast. When I went to Sean's wedding a few years after his arrival, there were so many illegals in attendance I kept waiting for the INS to raid the church.

Today many of those immigrants are still living in the U.S. But the stream of Irish illegals has almost completely dried up, and at least some of those who came to the States a decade ago have returned to Ireland. That's a stunning reversal. And it suggests that our current immigration crisis isn't as intractable as it seems.

Of course, the problem is enormous. It's no exaggeration to say that the United States has lost control of its immigration policies. Fully one-third of the nation's foreign-born population--12 million people--is living in the United States illegally. The vast majority of those migrants came across the porous southern border: Over half are from Mexico, another 30 percent from elsewhere in Latin America. Marginalized by poverty, language, and law, they are relegated to the lowest-paying jobs, least-desirable neighborhoods, and worst schools America has to offer. Still they keep coming--about 1,900 people a day on average, according to researchers at the Pew Hispanic Center.

How do you fix a system that's so badly broken? The simplest answer is to do nothing, a solution favored by some segments of the business community. They say that illegals fill jobs Americans don't want, such as picking fruit or cleaning hotel rooms, and by so doing keep wages low in industries that can't absorb high labor costs. But that argument ignores the social costs that illegal immigration imposes, most notably on undocumented workers themselves, who are left dangerously vulnerable to exploitation. In any case, there is virtually no public support for letting the system stand. The vast majority of Americans think illegal immigration is a serious problem, not a boon. And politicians from the President on down have promised to stanch, maybe even reverse, the flood of illegals.

Last year conservatives set the agenda. Just before the mid-term elections, Congress allocated $1.2 billion in new spending to seal the U.S.-Mexican border by adding more federal agents, deploying high-tech detection tools, and building 700 miles of fencing along the illegals' most well-traveled routes. Then, in mid-December the Department of Homeland Security staged highly publicized raids on Swift meat-packing plants in six states. Almost 1,300 workers were detained to await deportation.

It's hard to imagine a more futile set of policies. There's simply no way to close off 2,000 miles of border. As even Homeland Security Secretary Michael Chertoff admits, migrants will find new routes past the guards and the fences. In any case, half of all illegals don't sneak across the border at all. Like my cousin Sean, they enter the U.S. legally, then overstay their visas. Raiding American workplaces, meanwhile, disrupts the flow of business more than it does the flow of immigrants. No one really believes that a young man setting out from Oaxaca is going to turn back because federal agents raided a factory in Grand Island, Nebraska. But the arrests undoubtedly wreaked havoc with the managers and workers at Swift, which was already complying with federal programs to combat the hiring of illegal immigrants before the agents descended on the plants.

Moderate proposals don't look much better than their conservative counterparts. To their credit, moderates recognize that the 12 million illegals already in the U.S. aren't going to be caught and sent home, so most of them might as well be granted legal standing. And they don't promise to cut off new migration. They prefer to establish a guest worker program that will allow 200,000 migrants a year into the U.S. on extended visas. That sounds like a lot of people. But it's fewer than a third of the number crossing into the country illegally every year. The other two-thirds are to be kept out of the U.S. by the same beefed-up border security measures that conservatives favor--and that hold almost no promise of working.

The truth is, the immigration crisis isn't going to be solved by restriction and coercion. It just may be solved, though, by flipping the formula that politicians are now using. Instead of threatening them, maybe the U.S. needs to give immigrants what most of them really want: the ability to stay home. All policymakers need is a little imagination, some political courage, and a model to follow.

That's where Ireland comes in.

The Irish started immigrating to the United States in massive numbers during the infamous potato famine of the 1840s. Though the famine soon ended, the immigrants kept coming. Almost five million Irish men and women arrived in the States between 1850 and 1965, when a new immigration law made it extremely difficult for prospective immigrants to get the visas they needed. For a decade or so, the number of Irish moving to the U.S. plunged. Then, in the late 1970s, young people like my cousin began to circumvent the rules. And in short order those 150,000 Irish illegals --4 percent of Ireland's population--had made their way to America.

Many of them didn't want to make the move at all. Traditionally, the Irish have a fierce attachment to home and family, and the thought of leaving them behind was absolutely wrenching. So they have long seen immigration not as an opportunity but as a form of exile, a decision forced upon them by circumstances. They weren't wrong. For most of the 20th century Ireland was an economic basket case. Its industrial base was so meager, its infrastructure so poor, its educational system so antiquated the country couldn't create enough jobs for its people. As late as 1985, Ireland's unemployment rate stood at a staggering 17 percent. The Irish had no choice, really, but to go abroad, legally if they could, illegally if they had to.

Then everything changed. The European Union began to pour development aid into Ireland, helping to build new roads, update airports, improve communication networks, and upgrade schools. The Irish government did its bit as well. Officials invested heavily in high schools and universities in hopes of building a highly skilled labor force. They slashed corporate taxes on foreign companies and aggressively pursued investment opportunities from cutting-edge firms, first in computers, then in pharmaceuticals and medical technology. And they abandoned the protectionism that had long marked Ireland's foreign policy in favor of the free trade opportunities the EU had to offer. Together, these changes triggered a boom of extraordinary proportions. In the latter half of the 1990s, Ireland's economy grew at an annual rate of 7 percent. Factories bloomed in the heather. Dot-commers came calling. Unemployment plummeted. And with that, illegal immigration from Ireland essentially evaporated.

There's no guarantee that today's immigration crisis could be solved in the same way. Mexico is much more complex than Ireland. It's 23 times larger in land mass and has 25 times the population. Its poverty is more intense, its political system less stable. And its people--like the Irish deeply rooted in their native soil--are even more desperate to find decent jobs. Move to other parts of Latin America and the situation grows even more complicated, even more desperate.

But in recent years Mexico at least has embraced key components of the Irish model. It's integrated into a hemispheric trade organization. It welcomes foreign investment. And it has improved its educational system substantially. Newly inaugurated president Felipe Calderón has pledged to push those policies forward. To be sure, Mexico still has a long way to go: fixing structural inefficiencies, addressing its profound economic inequalities, and healing its fractured political system. It's the other side of the equation, though--the foreign investment side--that's really lagging. At its peak, the European Union's investment in Ireland reached about 5 percent of Ireland's gross domestic product. Apply that formula to Mexico, substituting the United States for the EU. (The U.S. and the EU have about the same size GDP, so the comparison is fair enough.) The U.S. would be giving its neighbor to the south $28 billion in development aid. Last year, U.S. aid to Mexico fell a bit short of that mark. It totaled $33 million.

It would be beyond naive to believe that Washington will ever come close to setting aside such a colossal sum to promote Mexican development. But imagine what a smaller figure--say, the $1.2 billion Congress recently allocated for border security--might do. Instead of putting up 700 miles of fencing, Americans might help build hundreds of new schools or expand mile upon mile of roads. As those improvements slowly accumulated, maybe Mexico could feel a bit of the economic surge Ireland experienced. If that should happen, many Mexicans would decide that there's no reason to leave their families, their friends, their neighborhoods to search for work in another country. That's what all my other Irish cousins decided. And as far as I know, they're happy to be home.

Kevin Boyle teaches American history at Ohio State University. His book Arc of Justice: A Saga of Race, Civil Rights, and Murder in the Jazz Age received the 2004 National Book Award for nonfiction.