When intervening in an invasion between two of my allies, a number of interesting things happened:
1. The diplomatic relationship did not suffer from me attacking one of my allies to protect the other (has been reported before)
2. The alliance did not dissolve with the party whom I attacked (also reported)
3. Battle ended when all the ships protecting my weaker allies planet have been destroyed although its planetary defenses remained (this is new)
So once the battle was over, I was still standing next to the planet together with the invasion force
Logically the battle should have continued until one of the original two side was totally annihilated, but as the attacker did not retreat, nor the planet destroyed, I guess this is a bug in this scenario