This symbol of the party was born in the imagination of cartoonist Thomas Nast and first appeared in Harper's Weekly on November 7, 1874.
An 1860 issue of Railsplitter and an 1872 cartoon in Harper's Weekly connected elephants with Republicans, but it was Nast who provided the party with its symbol.
Oddly, two unconnected events led to the birth of the Republican Elephant. James Gordon Bennett's New York Herald raised the cry of "Caesarism" in connection with the possibility of a thirdterm try for President Ulysses S. Grant. The issue was taken up by the Democratic politicians in 1874, halfway through Grant's second term and just before the midterm elections, and helped disaffect Republican voters.
While the illustrated journals were depicting Grant wearing a crown, the Herald involved itself in another circulation-builder in an entirely different, nonpolitical area. This was the Central Park Menagerie Scare of 1874, a delightful hoax perpetrated by the Herald. They ran a story, totally untrue, that the animals in the zoo had broken loose and were roaming the wilds of New York's Central Park in search of prey.
Cartoonist Thomas Nast took the two examples of the Herald enterprise and put them together in a cartoon for Harper's Weekly. He showed an ass (symbolizing the Herald) wearing a lion's skin (the scary prospect of Caesarism) frightening away the animals in the forest (Central Park). The caption quoted a familiar fable: "An ass having put on a lion's skin roamed about in the forest and amused himself by frightening all the foolish animals he met within his wanderings."
One of the foolish animals in the cartoon was an elephant, representing the Republican vote - not the party, the Republican vote - which was being frightened away from its normal ties by the phony scare of Caesarism. In a subsequent cartoon on November 21, 1874, after the election in which the Republicans did badly, Nast followed up the idea by showing the elephant in a trap, illustrating the way the Republican vote had been decoyed from its normal allegiance. Other cartoonists picked up the symbol, and the elephant soon ceased to be the vote and became the party itself: the jackass, now referred to as the donkey, made a natural transition from representing the Herald to representing the Democratic party that had frightened the elephant.
--From William Safire's New Language of Politics, Revised edition, Collier Books, New York, 1972