Having said this, I would also tell you that you MUST only spank after you have:
0. Make sure your child knows here is this consequence if they injure someone. Let them know there is a consequence! Do not let them think that arbitrary punishments or retribution occurs. This will do more harm than good if you do not set the expectations. It's not entirely possible to always do this the first time or with very, very small children (such as a two year old that has a biting problem as an example and which is very damaging behavior).
1. Explained what is about to happen carefully and fully.
2. Only spank once or a couple of times in a very controlled and sterile manner. Do NOT get emotionally involved in the spanking except to feel bad that you are doing it. DO NOT SPANK IF YOU ARE ANGRY. DON'T DO IT. NEVER.
3. After the spanking show your child MORE love and care. Give them high levels of tenderness and show them that it hurt you to execute this punishment. If you can cry with them, CRY WITH THEM. This is very important to show forth more love after the punishment and by doing this you will actually improve your bond with your child and allow them to know that you harbor no ill will against them.
4. Remind them in the future about the consequences that will occur if they choose to harm someone else as they have done.
5. Always show your child love and always let them know you suffer when they suffer now and always. Learn empathy and if you cannot have it, then show sympathy and love them anyway even if you cannot feel such things yourself.