Nathaniel Hawthorne was born on July 4, 1804, in a small house three blocks from the Custom House. By the 1840s, he was a well known author, but he found it difficult to support his family on his writing. Fortunately, his best friend was Franklin Pierce, who later became President of the United States. Pierce and other friends in the Democratic Party got the job of Surveyor for Hawthorne (who had worked for the Customs Service in Boston a few years earlier) in 1846. With the change in administration from the Democratic to the Whig Party in 1848, however, Hawthorne lost his job after a painful and prolonged fight to continue as Surveyor.
He turned the pain, anger, and betrayal he felt into his first great novel, The Scarlet Letter. In the introduction to the novel, he describes the Salem Custom House and pretends to find the story among the papers of a previous surveyor.