The two major presidential candidates are poles apart in their approach to immigration, but neither has a credible plan to end illegal immigration and restore order to the border.

Hillary Clinton favors legalization and eventual citizenship for most of the 11 million undocumented immigrants living in the United States, but she has no convincing solution to end future illegal immigration. Donald Trump wants to deport or deny legalization to most of the current immigrants living here illegally, and he proposes to reduce the future inflow by building a massive wall along the U.S.-Mexican border. Both plans are bound to fail.

Trump’s ill-considered plan to muster a “deportation force” and expel everyone living illegally in the United States was never credible. Hunting down and deporting millions of people would be an economic and humanitarian disaster. It would tear families apart, disrupt important sectors of the U.S. economy, and cost taxpayers billions of dollars.

The vast majority of undocumented workers aren’t criminals. A comprehensive 2015 study by the National Academy of Sciences concluded, “Immigrants are less likely than the native-born to commit crimes, and neighborhoods with greater concentrations of immigrants have much lower rates of crime and violence than comparable non-immigrant neighborhoods.” That includes lower-skilled immigrants from Mexico and Central America, who are the most likely to be in the United States without documentation.

Almost all illegal immigrants are peaceful, hard-working members of their communities. Most belong to families that include U.S. citizens and citizen children. A majority have lived in the United States for more than half a decade, a third for a full decade or more. They fill vital jobs in sectors such as agriculture, hospitality, retail and other services. Yanking them from the workplace would cause those industries to contract, reducing investment, and putting at risk the jobs of managers, accountants, sales representatives and other middle-class U.S. citizens.

The only humane and practical solution to illegal immigration is earned legalization for those who are already living and working here, and expanded opportunities for the legal entry of future workers.

Legalization of immigrants already here would not be blanket “amnesty.” Newly legalized immigrants can be required to pay fines and back taxes and submit to background vetting. They wouldn’t necessarily qualify for an automatic path to citizenship.

Legalization will enhance our security by bringing people out of the shadows. We would know who is here, and the legalized immigrants would have more incentive to cooperate with law enforcement. Those with real criminal records or any connection to terrorism could be more likely to stand out and would be subject to prosecution and deportation.

The Immigration Reform and Control Act of 1986 failed to end illegal immigration because it did nothing to expand future opportunities for legal entry. Our economy continues to create demand for low-skilled workers at a time when the number of American workers willing to fill those jobs continues to shrink. Yet we lack a workable temporary visa program for low-skilled workers that can respond to the needs of dynamic labor markets. The predictable result is illegal immigration.

If Mexican and Central American workers are allowed to enter our country legally to fill jobs, they will be far less likely to enter illegally. That was our national experience in the mid-1950s, when Congress dramatically expanded the number of temporary-worker visas. The result was a 95 percent drop in apprehensions at the southern border.

An expanded temporary-visa program would free U.S. Border Patrol agents to concentrate on intercepting real criminals. Internally, it would lessen the temptation to hire workers here illegally, in turn reducing the need to raid workplaces and impose other burdens on American citizens.

By reducing pressure on the U.S.-Mexican border, expanded legal migration would eliminate any rationale for building an ugly, expensive and futile wall. A third or more of illegal immigrants in the United States entered legally but then overstayed their visas, so a wall would do nothing to keep them out. With far fewer people trying to cross the border illegally, the U.S. Border Patrol would be able to keep bad people out without the building of a wall.

The U.S. government can drastically and permanently reduce illegal immigration by legalizing the millions of peaceful, hardworking immigrants already here, and expanding the door for more legal workers in the future — and without the huge economic and human costs of a wall and mass deportations.