Capital punishment is a legal penalty in 27 states, American Samoa, the federal government, and the military. It can be imposed for treason, espionage, murder, large-scale drug trafficking, or attempted murder of a witness, juror, or court officer in certain cases.