Andrew Gyory is a historian and author of "Closing the Gate: Race, Politics, and the Chinese Exclusion Act."

Whether Donald Trump eventually wins the 2016 Republican nomination, he could still leave an indelible and ugly mark on U.S. politics and policy. If that sounds far-fetched, American history suggests otherwise.

Trump’s demagoguery isn’t just borderline racist. And  it’s not even the first time we’ve heard it from a leading presidential contender.

His latest demand for “a total and complete shutdown of Muslims entering the United States” because of “the dangerous threat” they pose, coupled with his earlier attacks on Mexican immigrants as “rapists” and drug smugglers, have already transformed the national discourse on immigration. But more than a century ago, two charismatic figures — Denis Kearney, a businessman-turned-politician from California, and James G. Blaine, a senator from Maine and one of the leading contenders for the 1880 Republican nomination — uttered similar epithets, directed not at Muslims or Mexicans but at immigrants from China, whom they labeled “parasites” and “social pariahs,” and whom many of their contemporaries regarded as slaves.

Kearney was himself an immigrant, born in Ireland in 1847. After he settled in San Francisco more than two decades later, a major depression struck the nation, hitting California especially hard. Many blamed Chinese immigrants for the state’s faltering economy. “These leprous Chinamen are about the meanest creatures that God Almighty ever put breath into,” he told a crowd in Boston during a speaking tour in 1878. “The question is,” he asked, “are the Chinamen to occupy this country or the white man?” Denouncing their “putrid carcasses,” crowded living conditions and diet of “rice and rats,” Kearney implored his audience to expel the Chinese and stop more from entering — not unlike Trump, who has proposed mass deportations and building a wall along the U.S.-Mexico border. Kearney described the Chinese immigrant community as a “weapon” used by the “grinding, grasping capitalists” against “the poor laboring men” and asked, “will you assist us in ridding this country of the moonlight lepers?”

Kearney presaged Trump in other ways as well, attacking established institutions and influential figures. He derided the media as “the lying, venial, venereal press,” belittled politicians as “cowardly whelps,” and lambasted financiers as “capitalistic vagabonds.” But as with Trump, immigration remained his signature issue — the one that drew crowds and gained headlines. “Every speech and every document written by me,” Kearney commented, “ended with the words, ‘And whatever happens the Chinese must go.’ ”

Newspapers mocked Kearney as a “booby” and an “eminent blatherskite.” But a few months after Kearney’s speaking tour, Blaine — a former speaker of the House of Representatives and future secretary of state — repeated many of his themes in a speech on the Senate floor. “The question lies in my mind thus,” he said in 1879, “either the Anglo-Saxon race will possess the Pacific slope or the Mongolians will possess it.” Echoing Kearney, Blaine warned that “the swarming coolies of Shanghai” and the “vast … incalculable hordes in China” were threatening to “throttle and impair the prosperity” of the United States.

Blaine later wrote: “If as a nation we have the right to keep out infectious diseases, if we have the right to exclude the criminal classes from coming to us, we surely have the right to exclude that immigration which reeks with impurity and which cannot come to us without plenteously sowing the seeds of moral and physical disease, destitution, and death.”

Unlike Kearney, whom newspapers dismissed as a “foul-mouthed demagogue,” Blaine was running for president. One of the nation’s most powerful men, he had nearly snagged the Republican nomination in 1876 and hoped his embrace of anti-immigrant politics would win him support from angry voters. Blaine’s stature legitimized the cause of immigration restriction and spurred many Republicans to mimic his views.

In 1880, the Republican national platform labeled Chinese immigration “a matter of grave concernment” and endorsed efforts to limit it. Two years later, Congress debated the Chinese Exclusion Act, a law that would ban virtually all immigrants from China for 10 years and bar them from becoming U.S. citizens. A handful of Republicans stood up to Kearney and Blaine’s appeals, unmasking the “old race prejudice” that underlay them. Such prejudice, Sen. George Frisbie Hoar stated, “has left its hideous and ineradicable stains in our history in crimes committed by every generation.” Hoar’s words gained few supporters, as overwhelming majorities of Republicans and Democrats in Congress approved the Chinese Exclusion Act in 1882.

Blaine would never make it to the White House, and Kearney would soon disappear from the national scene. But the language they used helped set America on a new path. The Chinese Exclusion Act was the first federal law passed banning a group of immigrants on the basis of race or nationality, and it established a precedent for broader restrictions on immigration — from Japan, Korea and other Asian countries in the early 1900s, and from Europe in the 1920s. Chinese exclusion remained in force until 1943.

Like Trump, Kearney and Blaine blended vibrant populism with virulent rhetoric. By demonizing one group of people and blaming them for the nation’s problems, they poisoned the debate over immigration policy. Ultimately, Trump’s words may or may not lead to a Muslim or Mexican Exclusion Act or other anti-immigrant legislation, but his abusive speech has catapulted him to the front of the Republican race and unleashed a xenophobic fervor not seen in years.