Changing word order in「彼らは一緒に敵と戦っていた。」


Consider the following two, almost identical sentences:

> (A) 彼らは一緒に敵{てき}と戦{たたか}っていた。  
>  They fought the enemy together.
>
> (B) 彼らは敵{てき}と一緒に戦{たたか}っていた。  
>  They fought mutually with the enemy.

  1. **Understanding the difference between (A) and (B).** I'm assuming (A) means "they fought an enemy together, on the same team"; whereas (B) means "they both independently fought the same enemy, but on two separate teams". Is this correct?
  2. **What causes (A) to differ from (B)?** What feature of these sentences is causing their meaning to change? Looks like it has something to do with word order?




Sentence (A) is simple and unambiguous; 一緒に and 敵と both modify 戦う
independently, so 彼ら were all fighting together. Although [Aと戦う "to fight with
A" is ambiguous](https://japanese.stackexchange.com/q/78201/5010) (you cannot
tell if A is your ally or enemy), 敵と戦う is interpreted virtually in only one
way.

> `彼ら` ⚔️ `敵`

Sentence (B) tends to mean something different from what you are thinking. It
would mean 彼ら are betrayers, i.e., 'they' have turned to the enemy side and
were fighting together. This is because 敵と is right before 一緒に, and Aと一緒に
normally means "together with A".

> `Someone` ⚔️ `敵 and 彼ら`

If you want to say "they both independently fought the same enemy", this would
be 彼らは独立して(同じ)敵と戦った or 彼らはそれぞれ別に(同じ)敵と戦った. You cannot use 一緒に in the first
place.

> `彼ら` ⚔️ `敵` ⚔️ `彼ら`




Sentence (A) is simple and unambiguous; 一緒に and 敵と both modify 戦う
independently, so 彼ら were all fighting together. Although [Aと戦う "to fight with
A" is ambiguous](https://japanese.stackexchange.com/q/78201/5010) (you cannot
tell if A is your ally or enemy), 敵と戦う is interpreted virtually in only one
way.

> `彼ら` ⚔️ `敵`

Sentence (B) tends to mean something different from what you are thinking. It
would mean 彼ら are betrayers, i.e., 'they' have turned to the enemy side and
were fighting together. This is because 敵と is right before 一緒に, and Aと一緒に
normally means "together with A".

> `Someone` ⚔️ `敵 and 彼ら`

If you want to say "they both independently fought the same enemy", this would
be 彼らは独立して(同じ)敵と戦った or 彼らはそれぞれ別に(同じ)敵と戦った. You cannot use 一緒に in the first
place.

> `彼ら` ⚔️ `敵` ⚔️ `彼ら`

