"one who favors a republican form of government or republican principles" (or, as Johnson puts it, "One who thinks a commonwealth without monarchy the best government"), 1690s; see republican (adj.).
With capital R-, in reference to a member of a specific U.S. political party (the Anti-Federalists) from 1782, though this was not the ancestor of the modern U.S. Republican Party, which dates from 1854. In between, National Republicans was a name of the party that opposed Jackson and rallied behind John Quincy Adams in late 1820s.
1790, "adherent or advocate of democracy," with reference to France, from French démocrate (18c., opposed to aristocrate), back-formation from démocratie (see democracy); formally revived in U.S. as a political party affiliation 1798, with a capital D. As a shortening of this, Demo (1793) is older than Dem (c. 1840). An earlier noun for "adherent of democracy" was democratian (1650s).