Ohhhhh goodness, yes. This is a pretty (in)famous part of warfare in the ancient world.
u/iphikrates describes it here for the Greeks:
https://www.reddit.com/r/AskHistorians/comments/5cqh74/what_actually_happens_when_a_city_is_sacked/
I'm sure more can be said about the evolution of this behavior over time and place. I think the thoroughness of the violence varied too. Rome's destruction of Carthage is probably a pretty good example of about as much violence as you could deliver, but on the other hand you also see cities recovering from sacks, sometimes even being sacked again in short order, so obviously their destruction wasn't so total.