From A Treasury of Stephen Foster (Random Hpuse, 1946, p. 159) [Historical notes by John Tasker Howard]:
This song is popularly supposed to have been the last that Stephen Foster composed. The tradition began with the publisher's statement, on the title-page of the original edition, that it was "the last song ever written by Stephen C. Foster, composed but a few days previous to his death." In making this claim, the publishers were guilty of a deliberate misstatement, for incontrovertible evidence shows that the manuscript of the song had been in their possession for at least two years before Foster's death. Careful examination of the first edition, which was actually entered for copyright March 10, 1864 (two months after Foster's death), shows that the copyright notice at the bottom of the first page of music is dated 1862. Further, in July of 1863, when the same publishers (Firth, Pond & Company) issued Foster's Willie Has Gone to the War, they announced on the title-page that it was composed by the author of Beautiful Dreamer. These facts indicate that Firth, Pond & Company actually bought Beautiful Dreamer from Foster in 1862, and had the plates for the song engraved. For some reason they did not issue the song at that time, but when they subsequently published Willie Has Gone to the War they overlooked the fact that Beautiful Dreamer had not been issued, and mentioned it on the title-page of the "Willie" song. After Foster's death (January 13, 1864) other publishers began to turn out "last songs" by Foster, so Firth, Pond & Company, who had been Stephen's principal publishers in his best years, apparently decided that they too must have a last song. Since Beautiful Dreamer was already engraved, they issued it in a hurry, and shamelessly announced it as his last work.
See the title pages of "Beautiful Dreamer" (which seems not to be the first edition since there's no copyrigth notice on the music page) and "Willie Had Gone to the War" (at the Levy Collection):
Title: Willie Has Gone To The War. Song & Chorus. Composer, Lyricist, Arranger: Words by George Cooper, Esq. Music by Stephen C. Foster. Stephen C. Foster Publication: New York: Wm. A. Pond & Co., 547 Broadway, 1863.
"The earliest known copy" is reproduced in The Music of Stephen Foster, vol. 2 (pp. 237-241) by Saunders and Root.
Interestingly, the publishers altered the words ("the latest song" to "one of the latest songs"; "but a few days previous to his death" to "a short time before his death") in a later edition: