Mexican nationals deported from the United States protest by painting graffiti over an image of Donald Trump on a section of the border fence between Mexico and the United States, on the outskirts of Tijuana, Mexico, on May 10. (Reuters)

On the campaign trail, Donald Trump hated NAFTA. Hated it.

“NAFTA has been a disaster for our country,” he said. “NAFTA has to be totally gotten rid of. Something has to happen with NAFTA.”

But President Trump seems to have softened on the deal. In a muted letter to Congress, the administration outlined the tweaks it wants to make to the 1994 pact. Among them: a provision that would reinstate tariffs if a flood of imports threatens a domestic industry; a call for more U.S.-made goods to be considered in government procurement; and expanded market access and fewer licensing and permit barriers. NAFTA's arbitration tribunals — despised by free-trade critics for giving corporations unbridled power to challenge a foreign government in secret — will stay.

Gone were the threats about pulling out altogether or requiring massive rewrites. (Though Mark Warner, a Canadian American trade lawyer, did tell the New York Times that even these changes are going to be tough to implement. “It’s not ripping up Nafta, but there are a bunch of sticks of dynamite contained in those pages,” he said. “It’s going to be a messy, hard-slogging negotiation.")

That's about par for the course. The deal has been loved, hated and debated by just about everyone over the last two decades.

The idea first entered American political consciousness in the late 1970s. Ronald Reagan campaigned on the idea of a “North American common market” in 1980, imagining a world where goods and services moved friction-free across the continent. It seemed like a fantasy at the time, but in 1987, he signed a free-trade agreement with Canada.

Mexico saw those beneficial effects and wanted in on the action. It asked President George H.W. Bush for a broader free-trade deal. That effort was led by Mexico's top telecommunications executives, who wanted to kick-start the country's flagging economy. American officials, such as Henry Kissinger and David Rockefeller, saw the potential, too — they wanted to provide factory owners in the United States with easy access to cheap labor. Also at the time, Mexican tariffs on U.S. imports were 250 percent higher than U.S. tariffs on Mexican imports. A trade deal, experts hoped, would make those tariffs more fair.

Bush thought a successful trade deal with Mexico would be a major achievement, and he pursued the agreement throughout his first term. By reelection time, his team had negotiated a deal. In 1991, Bush ran in part on the agreement. Bill Clinton was supportive, too, though he called for stronger environmental and labor protections. Only third-party candidate Ross Perot seemed to anticipate the backlash to come — he vehemently opposed the measure, warning voters to prepare for the “giant sucking sound” of 5 million American jobs moving across the border to Mexico.

The measure was hotly debated on the campaign trail. American unions, environmentalists and human rights activists worried that the deal would lead to terrible labor conditions on both sides of the border. But business leaders celebrated the potential access to cheaper goods and workers. Though Bush lost the election, he pushed the measure through and signed it right before he left office. “I believe the time will come when trade will be free from Alaska to Argentina,” he said at the time, “when every citizen of the Americas will have the opportunity to share in new growth and prosperity.”

But before it could go into effect, it had to be ratified by Congress. It wasn't an easy sell. Though Clinton supported the measure, Democratic lawmakers were reluctant because of fierce opposition from union leaders. Congress's top Democrats — House Majority Leader Richard Gephardt and House Majority Whip David Bonior — opposed it and ultimately voted against it.

On the campaign trail President Trump spoke out aggressively against NAFTA, calling it "the worst trade deal maybe ever signed anywhere." Economists have a more nuanced view of the deal struck in the early 1990s. (Daron Taylor/The Washington Post)

But the deal had its champions, particularly in the Republican Party. Its supporters argued that the deal would offer Americans access to cheaper goods, and that it would make American exports more affordable to the rest of the world. They also touted NAFTA's supposed job-creation ability, saying that the deal would bring 200,000 positions to the United States while reducing illegal immigration and drug trade from Mexico. The emerging European Union was building its own unified market, and economists hoped, too, that NAFTA would keep America competitive. NAFTA would create the world's largest free-trade market, affecting some 360 million consumers from three economies collectively generating $6 trillion a year.

Throughout the spring, Clinton and Republican Newt Gingrich (then minority whip) lobbied hard. It passed in August, 234 to 200 in the House and 61 to 38 in the Senate. When Clinton signed the treaty, he called it “just the first step” in an effort to incorporate much of Latin and South America into a “hemisphere-wide” free-trade deal.

NAFTA went into effect in January 1994, and it worked. Trade grew exponentially. Agricultural trade between the United States and Mexico tripled from $7.3 billion in 1994 to $20.1 billion in 2006. And the job cuts didn't come. But the Congressional Research Service said that the “net overall effect of NAFTA on the U.S. economy appears to have been relatively modest, primarily because trade with Canada and Mexico accounts for a small percentage of U.S. GDP.” The Economic Policy Institute pegs the jobs loss from NAFTA at about 700,000 through 2010. It did not, however, keep Mexican immigrants out. Americans got more militant in response. The number of U.S. Border Patrol agents at the border increased by 67 percent between 1994 and 1997, and it became much more militarized — at some points, as many as 10,000 U.S. soldiers were deployed to secure the border.