In the run up to the recent congressional elections, President Trump, abetted by Fox News, railed at the threat posed by a “caravan” of Central American migrants and asylum seekers making their way north through Mexico. Delighting his base, Trump pledged to block this “invasion” composed of alleged gang members, drug dealers, suspicious Middle Easterners, and generally “bad dudes.” Critics dismissed the president’s rhetoric and dispatch of active duty military units to the border as a political stunt. Trump, however, was hardly the first president to raise the specter of an invasion by or through Mexico to promote a wider political agenda.

In 1846, President James Polk utilized a clash between Mexican and U.S. forces near the disputed Texas border to launch a war that led to the annexation of about one-third of Mexico. Illinois Congressman Abraham Lincoln first gained notoriety the next year by demanding that Polk show Congress the “spot” where American soil had been violated. In March 1916, troops led by Mexican revolutionary Pancho Villa attacked several border towns, including a deadly raid on Columbus, New Mexico — hoping to provoke an American invasion that would generate a nationalist response in his favor.

President Woodrow Wilson (who previously supported Villa but now opposed ongoing Mexican efforts to restrict foreign control of minerals and land) obliged and dispatched 10,000 army troops to capture Villa, dead or alive. During the next 11 months the expeditionary force under General John “Black Jack” Pershing seemed more intent on pressuring the Mexican government to protect American-owned oil leases than actually catching their prey. Early in 1917, the crisis with Germany over its U-boat attacks on neutral ships prompted Wilson to withdraw the troops. German military observers in Mexico assured Berlin that the failure to catch Villa proved that U.S. entry into the European war on the Allied side would be inconsequential.

Oddly, in explaining the recent dispatch of troops to the Mexican border, Defense Secretary James Mattis justified the deployment by comparing the civilian caravan composed heavily of women and children to the armed attackers on Columbus.

During the 1980s, President Ronald Reagan justified intervention in Central America as vital to prevent an invasion of the United States by both armed adversaries and “millions of desperate refugees” from Central America and Mexico.

Since the takeover of Nicaragua by the leftist Sandinistas at the end of the Carter administration, Washington had provided aid to the Contras, armed opponents of the new regime. Reagan described the combatants as “freedom fighters” and heirs to the Minutemen of the American Revolution. Despite Reagan’s overall success in promoting rearmament and anti-communist policies abroad, the public remained wary of military intervention in Central America.

Congressional Democrats placed so many restrictions on assistance to the Contras that Reagan authorized his aides, such as NSC staffer Colonel Oliver North (recently chosen president of the National Rifle Association), to raise unrestricted funds from a network of wealthy conservative donors and friendly foreign governments. Frustrated by these constraints, in March 1986 Reagan upped the ante and demanded that Congress fund a new $100 million aid package for the Contras.

The president utilized his considerable communication skills in an effort to generate public pressure on a reluctant Congress. In televised speeches and other presentations, Reagan described Nicaragua as a Soviet-Cuban military base on the North American mainland, less than “two hours flying time” from U.S. territory. The Sandinista regime, he said, bolstered by agents from East Germany, the PLO, Libyan Col. Gadhafi, and members of the Italian Red Brigades, threatened its immediate neighbors, the Panama Canal and Caribbean Sea lanes. The Sandinistas, Reagan warned, intended to drive “millions of desperate” refugees north, flooding the cities of the American Southwest.

Presenting a vivid map that seemed to drip red, Reagan described Nicaragua as a “privileged sanctuary for terrorists and subversives just two days driving time from Harlingen, Texas.” In the president’s words, the Sandinistas were agents of the communist plan for world domination and believed “the road to victory (over the United States) goes through Mexico.”

In spite of this appeal, Congress approved only part of Reagan’s request. His effort to support the Contras and overthrow the Sandinista regime collapsed in the fall of 1986 when the Iran-Contra scandal broke. Most Americans were shocked to learn of the bizarre effort orchestrated by the president to sell arms to Iran, ransom Americans held in Lebanon, and fund the Contras with the profits from illegal arms sale to the ayatollah’s regime.

Reagan salvaged his presidency by convincing prosecutors that he simply couldn’t recall details of the scheme. He also regained public trust by reaching accommodations with Mikhail Gorbachev, the reformist leader of the Soviet Union. The White House largely disengaged from Nicaragua during the remainder of Reagan’s presidency, allowing the contestants to reach a peace deal of their own. Nothing more was heard about armed pickup trucks heading north to Texas.

Similarly, in the wake of the recent congressional election, both Fox News and Donald Trump have mostly moved on to other perceived national security threats, such as that posed by France’s prohibitively high tariffs on perfectly palatable American wines. However, the specter of an “invasion from the south” still lurks in darker corners of our politics.

Michael Schaller is Regents’ Professor emeritus of history at the University of Arizona. He has written several books on U.S. history, focusing on America’s international relations.