This carol was written in 1857 by the Reverend John Henry Hopkins. He wrote both words and music as part of a Christmas pageant for the General Theological Seminary in New York City. As it proved popular within his circle of family and friends, Hopkins decided to publish the carol in 1862.
The Beach Boys recorded this carol for their 1964 The Beach Boys' Christmas Album. At 4:04, it was the longest song the Beach Boys recorded in the entire 1960s.
Fun fact: The Bible does not say there were only three wise men. We assume that they were a trio because of the three gifts that were given: gold, incense, and myrrh.