US and Iran reach eleventh-hour ceasefire deal.