Also make sure you are not showing fear. He can sense when you are afraid and will do it even more. Like don't back away or anything, Try using something like a box lid or something and blocking him, It may discourage his attacks?
Why do you think he is doing that? Is he trying to protect something or someone? Maybe the girl? Maybe he feels threatened? Often Figuring out the cause can help solve the problem.