Almost 400 people have died in violence in western Myanmar that was triggered by attacks on security forces by insurgents from the Rohingya ethnic minority, Myanmar’s military said, as both sides exchanged charges of atrocities and thousands of Rohingya fled across the border to Bangladesh.