Envoy: ‘Devastating’ Israel-Hamas clash averted