The doctrine of baptism for the dead was first made known to members in the early days of the Church in a discourse by the Prophet Joseph Smith at the funeral of Elder Seymour Brunson, a member of the Nauvoo High Council, on Aug. 10, 1840. In 1841, the Lord revealed greater light regarding this ordinance saying it was to be performed in the temple (see D&C 124: 29-36), in a baptismal font beneath the ground, as a similitude of the grave. (See D&C 128:13.)
After this doctrine was revealed, the Lord permitted the Saints to perform baptisms for the dead in the Mississippi River until a font could be prepared in the basement of the Nauvoo Temple.
Source: Essentials in Church History, p. 252; Deseret News 1989-1990 Church Alamanc, p. 196.