Treaty obligation when allies go to war against each other

If the United States has defense treaties with Countries A and B (promising to use military force to protect those two countries if they are ever attacked by any enemy,) what happens if those two US allies go to war against each other?
Does the USA get to choose one nation to defend against the other? Is the USA free of its obligation and gets to say, “I won’t help either one?”

Didn’t this almost happen, when Greece and Turkey were arguing over Cyprus?

Ultimately, it would be a political question with a political answer. Most likely, the sensible thing would be for the US to stay the hell out of it while trying to promote peace. If push came to shove, however, the US might well decide that it’s going to stick with Country A, and Country B can go screw itself.

Wasn’t this what happened when Iraq invaded Kuwait? Iraq was a good little allie of the US and was fighting the Iranians for us by proxy so he figured we wouldn’t do anything about his invasion of Kuwait. Guess he figured we owed him one; he figured wrong.

There was no defense treaty with Iraq, just an arrangement.

Ultimately, a country can decide if it lives up to any obligations in the treaty. You can easily declare that a war between to member countries does not require you to join in (I wouldn’t be surprised if NATO has that sort of out as part of the treaty), and see what consequences – if any – you suffer.

It’s a** defense** treaty. You stand up to whomever is determined the aggressor, or stay out and admonish restraint if conditions are so muddled you can’t agree who first opted to attempt armed resolution of the conflict.

Wasn’t this the situation in the Falklands War, when Argentina, an ally of the United States, attacked a member of NATO?

I’m not sure if the US had any defence treaty with Argentina, but since they were the aggressors, any such treaty would not apply.

The NATO treaty has limits in that it only applies to attacks north of a certain latitude (and I can’t remember which one) but the Falklands are well south of that latitude.

And ultimately, this is always true of all treaty obligations. Even when a completely innocent ally is attacked from out of the blue by a non-ally, we could choose to stand by and do nothing. There would be consequences, of course (like, nobody else is going to want to sign defense treaties with us if we do that), but sometimes nations decide that those consequences are worth it.