Republicans in Congress say they won’t tackle immigration reform unless they win control of the Senate in the 2014 midterm elections. They want to be able to pass a bill that takes a harder line on illegal immigration.

As Sen. Chuck Grassley, R‑Iowa, said the other day, he voted against the 2013 immigration reform bill because it wasn’t tough enough on border security and internal enforcement.

What Grassley and other conservatives don’t understand is that in order to solve illegal immigration, we need to fix the legal immigration system first.

We’re never going to remedy the illegal immigration problem through greater emphasis on enforcement. An almost ninefold increase in the numbers of Border Patrol agents since 1980, more walls and fences to keep people out, and the aggressive enforcement of states like Arizona has barely stemmed the tide.

Making legal immigration an easier and smoother process would reduce the need to waste time and resources on futile enforcement mechanisms. Our current system makes it virtually impossible for lower-skilled immigrants to legally live and work in the United States. There is no green card category for lower-skilled immigrants, and current guest-worker visas are so regulated and expensive that very few migrants can use them to temporarily work here.

It wasn’t always like this. In the 19th and early 20th century, the United States didn’t have an illegal immigration problem because 98 percent of immigrants passing through ports like Ellis Island were accepted into the country. Peaceful and healthy immigrants could move here without quotas or the help of lawyers to navigate a maze of complicated immigration regulations.

But we don’t have to return to our century-old immigration system to fix illegal immigration today. Sensible solutions abound in our not-so-distant past.

In the early 1950s, there were about 2 million mostly Mexican immigrants working illegally in the United States. Instead of building fences or putting troops on the border, the U.S. created a guest worker visa, known as the Bracero Program, which channeled unauthorized immigrants into the legal migration system.

The Border Patrol handed migrant workers visas when they entered the United States. Sometimes they even legalized illegal immigrants on the spot, photographed them and handed them a work permit. This less-restrictive system incentivized prospective immigrants to come legally.

By 1955, the flow of unauthorized immigrants and their total population decreased by about 90 percent, even as the size of the Border Patrol shrunk. The Bracero Program shows that legal immigration can replace illegal immigration, to the benefit of everyone.

By contrast, today’s guest-worker visas are prohibitive, overregulated and encourage unauthorized immigration. As Rep. Raul Labrador, R‑Idaho, recently said, “It’s easier to hire illegally.” A simpler, more-open and less-regulated visa is sorely needed.

A new visa should allow migrants to change jobs and work in different sectors of the economy without government permission. Tying guest workers to specific employers, as we do now, is a recipe for abuse, corruption and over-regulation.

Most of the public debate over immigration reform centers on the 11 million to 12 million unauthorized immigrants. While legalizing the peaceful and otherwise law-abiding unauthorized immigrants here is an important piece of reform, solving the legal immigration system is the most crucial part of long-term reform.

We’ve tried the tougher enforcement route. It doesn’t work. When Congress finally decides to tackle immigration reform, it should heed the lesson of history by opening up legal migration as the antidote to illegal immigration.