The trade deal many Americans blame for job losses has a complicated record of success and failure. Here's everything you need to know:

What did NAFTA do?
The North American Free Trade Agreement was a 1994 accord between the U.S., Canada, and Mexico that lifted tariffs on most products moving between the three nations. It was also the first trade agreement to include protections for intellectual property. NAFTA had bipartisan backing, having been negotiated by a Republican president — George H.W. Bush — and signed by his Democratic successor, Bill Clinton, after passing the Senate 61-38. But it has also met stiff opposition across the political spectrum. The nascent agreement was a flashpoint in the 1992 presidential race (see below); a quarter-century later, NAFTA and other free-trade deals fueled a wave of populist anger among voters who blamed outsourcing for the major decline in U.S. manufacturing jobs. During the 2016 campaign, NAFTA was flogged relentlessly by Democratic Sen. Bernie Sanders and by Republican Donald Trump, who called it "the single worst trade deal ever approved in this country." Now President Trump says he will fulfill his campaign promise to renegotiate the pact.

What was the rationale of the agreement?
There were several goals. The U.S. wanted to bring Mexico's developing economy into the first world, on the premise that creating jobs there would curb illegal immigration. As then–Mexican President Carlos Salinas de Gortari put it, his country would "export goods, not people." For the U.S. and Canada, meanwhile, Mexico was seen as fertile ground for exports and investment. President Clinton predicted that free trade would boost the economies of all three countries. "NAFTA means jobs," he said. "American jobs, and good-paying American jobs. If I didn't believe that, I wouldn't support this agreement."

So how did it work out?
The broad consensus is that NAFTA has a mixed legacy. A 2015 report by the nonpartisan Congressional Research Service said the deal "did not cause the huge job losses feared by the critics or the large economic gains predicted by supporters," and called NAFTA's net effect on the U.S. economy "relatively modest." Trade between the three signatories has grown considerably, from about $290 billion in 1993 to more than $1.1 trillion last year. Supporters say the agreement has helped employ 14 million Americans in fields such as retail, finance, and agriculture, and provided cheaper goods to U.S. consumers. "About 5 million American jobs are directly tied to trade with Mexico, and 9 million are tied to trade with Canada," says University of Calgary economist Eugene Beaulieu. But critics argue that the downsides of NAFTA and other trade deals outweigh the benefits.

What downsides?
In the two decades since NAFTA, the balance of trade between the U.S. and Mexico flip-flopped, from a $1.7 billion American surplus to a $49.2 billion deficit. Analysts such as Robert Scott of the Economic Policy Institute estimate that nearly 700,000 U.S. workers lost good jobs as a result, mostly in manufacturing; those who kept their jobs saw wages flatline, at least partly because of Mexican competition. "The most-affected workers were college dropouts working in industries that depended heavily on tariff protections in place prior to NAFTA," says University of Virginia economist John McLaren. But economists say that NAFTA alone didn't cause their pain, citing the rise of China as an economic powerhouse, the 2008 financial collapse, and — above all, perhaps — automation and new technology that rendered many 20th-century jobs obsolete.

Did NAFTA help curb illegal immigration?
Clearly, the deal hasn't delivered on that promise: The number of undocumented immigrants in the U.S. quadrupled after NAFTA's signing, from 3 million in 1994 to 12 million in 2007. The impact on Mexico's economic growth and wages also has not met expectations; while the country probably gained about 600,000 jobs in the manufacturing sector, it lost at least 2 million more in agriculture, thanks to cheap imports of U.S. corn and other produce. With their economy also weighed down by competition from China and a range of domestic factors, "jobless Mexicans migrated to the U.S. at an unprecedented rate of half a million a year after NAFTA," says Laura Carlsen of the nonprofit Center for International Policy. Since the Great Recession of 2008, however, the net influx has been negative, with more Mexican nationals returning to their home country than arriving.

What does Trump plan to do?
He's floated several options, including threatening to pull out of NAFTA altogether and impose a 35 percent tariff on Mexican goods. It's likely he'll first try to renegotiate the deal — but he's been vague about the changes he'd seek. The U.S. Chamber of Commerce and other business groups fear that radical revisions could wreck the complex interdependency of the three countries' economies and imperil millions of jobs. Most economists agree NAFTA could use updating; one popular proposal is to require Mexico to increase wages, labor standards, and environmental rules, which would lessen the advantages of outsourcing. But most economists do not believe that changing NAFTA — or scrapping it — will usher in a Rust Belt renaissance. "Far more jobs have been automated than outsourced," says economist Zachary Karabell. "Most of the jobs that disappeared over the past decades can never exist again. Period."

That 'giant sucking sound'
Third-party candidate H. Ross Perot roiled the 1992 presidential election with populist economic rhetoric — including fierce opposition to NAFTA. Like Trump, the Texan was a blunt billionaire who won a large following by advocating protectionist trade policies. Perot, now 86, created one of the more memorable moments in the annals of presidential debates in an attack on NAFTA. "We have got to stop sending jobs overseas," he said, warning that if business owners could move their factories to Mexico and "pay a dollar an hour for labor," the resulting loss of American jobs would create "a giant sucking sound." Whether Perot's zinger proved prescient is hotly debated, but his message resonated: He drew 18.9 percent of the popular vote and, most experts agree, enough conservative support to help Democrat Bill Clinton defeat incumbent Republican George H.W. Bush.