2 nuclear-armed powers agreed to ceasefire after days of heightened military escalation amid cross-border missile strikes