The relationship between Mormonism and Freemasonry began early in the life Joseph Smith, founder of the Latter Day Saint movement, as his older brother Hyrum and possibly his father were Freemasons while the family lived near Palmyra, New York. Nevertheless, in the late 1820s, the western New York region was swept with anti-Masonic fervor.
By the 1840s, however, Smith and several prominent Latter Day Saint had become Freemasons and founded a lodge in Nauvoo, Illinois, in March 1842. Soon after joining Freemasonry, Smith introduced a temple endowmentceremony including a number of symbolic elements that were very similar to those in Freemasonry. Smith remained a Freemason until his death; however, later leaders in the movement have distanced themselves from Freemasonry. In modern times, The Church of Jesus Christ of Latter-day Saints (LDS Church), the predominant Latter Day Saint sect, holds no position for or against the compatibility of Masonry with LDS Church doctrine.
the source: Wikipedia