Hammett was born on a farm in St. Mary's County, in Maryland. His parents were Richard Thomas Hammett and Anne Bond Dashiell. Hammett was baptized a Catholic. He grew up in Philadelphia and Baltimore. "Sam," as he was known before he began writing, left school when he was 13 years old. He had several jobs before working for the Pinkerton National Detective Agency. He served as an operative for the Pinkertons from 1915 to February 1922. He took time off to serve in World War I. He did not like the agency's role in union strike-breaking.