If you are about to be defeated in combat, you can run to this guard for help. Try it out by attacking something close to to the guard, and watch his reaction. It is better to be safe than sorry.
Look at the guard's health bar. It is red, which means he is much stronger than you. You should absolutely NOT attack him, especially since he is on your side.