According to a UC Davis history professor, it goes back just a tiny bit further. Recommended reading.
Republicans identifying threats to social order were not wrong. Anarchists, communists, socialists, and even plain old trade unionists could cause chaos. But the GOP depicted every eruption of unruliness as a menace equal to the Confederacy. Every time was "a time like this," in Garfield's phrase, requiring stern leaders to discipline their people.
The enemy within was eternal and everywhere because the enemy was within each of us. "The worst evil that could be inflicted upon the youth of this land would be to leave them without restraint and completely at the mercy of their own uncontrolled inclinations," Coolidge said. Republicans knew what evil lurked in the hearts of their fellow men because they fought it within themselves. "How lofty is the nature of Mr. Lincoln," Blaine wrote during the Civil War. "How he keeps himself free from the ordinary passions ... . He has gained control over others by constantly maintaining it over himself."
Politicians who persuade themselves they've controlled their worst impulses and thus entitled themselves to control yours, who identify the good of their party with the good of the country, who see every dissenter as an enemy, can justify breaking the law--or so nineteenth-century Blaine-watchers concluded. The astute political observer Henry Adams thinly fictionalized Blaine in his novel Democracy as Senator Silas Ratcliffe, and let him defend his shady behavior thus: "We believed ... that the result of that election would be almost as important to the nation as the result of the war itself. Our defeat meant that the government must pass into the blood-stained hands of rebels, men whose designs were more than doubtful." It was a sincere belief, and also politically useful: Rutherford B. Hayes, seeking to avoid charges of party corruption in 1876, told Garfield, "Our main issue must be It is not safe to allow the Rebellion to come into power.