Liǎng guó shìbīng bìngjiānzuòzhàn, dǎbài le dírén.
Soldiers from both countries fought side by side and defeated the enemy.
Tips
usage
并肩作战 can be used literally (military allies) or figuratively (colleagues, friends working together on a challenge). The figurative use is more common in modern Chinese.