That's the US and I'm sure there is some clusterfuck between state law and federal law in a lot of places. But hence "It depends on the law". In general, if the death penality is legal and it's carried out according to the law, it's a lawful killing.
Personally I'm very much against the death penalty and I'm glad we don't have it here.