In 1890, the U.S. Supreme Court — in upheld laws intended to disenfranchise Mormon polygamists. The 1882 Edmunds Anti-Polygamy Act required voters to swear that they were not polygamists, and the Idaho Territory had passed a statute requiring voters to attest that they were not Mormons. In Idaho, church member Samuel Davis was convicted of conspiring to swear falsely in order to sidestep the recently passed statute. In Davis v. Beason, the Court ruled that “however free the exercise of religion may be, it must be subordinate to the criminal law of the country.” Idaho could disenfranchise Mormons, polygamists and monogamists alike. In Davis, the Court held that polygamy was an affront to the values of Christianity and civilization, which it viewed as inseparably connected. (See Sarah Barringer Gordon’s The Mormon Question).

Two years later (in Holy Trinity), the Court explicitly asserted that “we are a Christian people, and the morality of the country is deeply engrafted upon Christianity.” As the polygamy cases suggest, the Court sought to uphold particular forms of Christianity.

As of early 1890, the U.S. government had the Church of Jesus Christ of Latter-day Saints in a legal vise, and it was turning the screws. Courts had incarcerated thousands of church members, including high-ranking leaders (other high-ranking leaders went “underground” to avoid arrest). The U.S. government had revoked the church’s incorporation and seized valuable church-owned property. And federal judges were refusing to naturalize Mormon emigrants.

In the 2007 PBS documentary The Mormons, Ken Verdoia observed that in nineteenth-century America, to be called a “Mormon” was like being called a “Muslim terrorist” today. There was no shortage of accusations that Mormons in Utah in particular exacted violence on Gentiles, apostates, and romantic competitors (see Sherlock Holmes’s Study in Scarlet, for example). As Patrick Mason narrates in his Menace of Mormonism, two Mormon missionaries were murdered in the post-Reconstruction U.S. South (in 1879 and 1884, respectively), and many other missionaries endured violence, threats, and harassment.

The “Muslim terrorist” / “Mormon” identification seems a bit of a stretch, but perhaps one could draw a more general analogy between the place of nineteenth-century Mormons in the United States and contemporary rhetoric about Muslims in America. My aim is not to draw an exact parallel but to raise some points of similarity.

Between its 1830 founding and 1846, the Church of Jesus Christ of Latter-day Saints had endured several cycles of gathering, persecution, and exile in the Eastern United States. Initial objections to Mormonism centered on the church’s doctrine of gathering and the fear that once Mormons gained a majority in a particular city or county that they would tyrannize those who did not belong to their church. Once the Latter-day Saints reached Utah and announced their practice of polygamy, the latter issue dominated American anti-Mormon rhetoric, but the political conflict was as much about theocracy and sovereignty as it was about marriage and morality. Much as Protestant Americans doubted the patriotism of Catholic immigrants, so they insisted that the Mormon ethic of obedience to ecclesiastical leaders called their loyalty to the nation into question.

Were any of these fears about Mormonism well grounded? The 1857-1858 Utah War and Mountain Meadows Massacre created justifiable suspicions about whether the Latter-day Saints acknowledged American sovereignty and whether the Utah Territory was a safe place for outsiders. Latter-day Saints had some justifiable suspicions about American intentions as well. Still, by the 1880s, the idea that the Mormons posed a significant political or moral threat to the rest of the country was far-fetched at best.

Especially from the 1840s through the 1860s, large numbers of Mormons were emigrants (mostly from the British Isles), and many Americans warned about the dangers that Mormon emigrants posed to the morality and political fabric of the nation. As late as 1919, the National Reform Association (a once influential Protestant group that had lobbied Congress to insert an explicit declaration of Christianity into the U.S. Constitution) accused the church of bringing “great numbers of women and girls from other states and from foreign countries to Utah, and this for unlawful and immoral purposes.” A conference of the NRA called on the national government to expel Mormon members of Congress, ban the circulation of Mormon literature, and warn foreign governments about Mormon missionaries.

In the end, the U.S. government forced the LDS Church to abandon polygamy, and Mormons promptly became model patriots. The long history of the “Mormon question” in American politics, though, is a cautionary tale. For a half-century, Mormonism was a national political issue that occasionally took center stage (during the 1857-1858 conflict, the Mountain Meadows Massacre trials, and the Reed Smoot hearings of the early 1900s, for instance). Regardless of how one feels about the constitutionality of anti-polygamy legislation, Mormons even before they practiced polygamy had endured severe persecution and hostility.

Not surprisingly in light of its history, the LDS Church two days ago released a statement proclaiming that while the church is “neutral in regard to party politics and election campaigns … it is not neutral in relation to religious freedom.” As evidence, the church pointed to an 1841 Nauvoo, Illinois, ordinance promising “free toleration” not only to Mormons and Protestants, but also to Catholics, Quakers, Universalists, Unitarians, and — yes — “Mohammedans.”

Those rightfully appalled at Donald Trump’s insistence that all Muslim visitors to the United States are potential terrorists and should therefore be banned from entering the country should remember that anti-religious bigotry was woven into the fabric of nineteenth-century American politics and culture. The vitriol that late-nineteenth-century politicians of both parties employed against Mormons far exceeded what Donald Trump uses against Muslims today. And such ideas touched not only Mormons, but Catholics, Jews, and other groups as well. The free exercise of religion in American history has been contested, sometimes violent terrain.