In 1845 Hawthorne again went to work as a customs surveyor, this time at a post in Salem. In 1850, after having lost the job, he published The Scarlet Letter, which enjoyed critical acclaim and became an instant commercial success. The House of the Seven Gables appeared the following year and fared even better—its initial sales exceeded even those of The Scarlet Letter. Ultimately, however, The House of the Seven Gables proved less popular with both readers and critics. Nonetheless, the two books together made Hawthorne a wealthy man. In 1853, Hawthorne’s college friend Franklin Pierce, for whom he had written a campaign biography and who had since become president, appointed Hawthorne a United States consul. The writer spent the next six years in Europe. He died in 1864, a few years after returning to America.