Firm and consistent
Be consistent! you need to respond to this immediately, every time with a consistent routine.
Make it short, to the point and simple as too much explaining the way it 'hurts others' etc will only draw more attention to an attention seeking behavior. A short, loud, firm 'no hitting' and then remove to a timeout away from your attention. Resist the urge to explain why, just remove and move on.