The announcement of a two-week ceasefire came after Trump posted a heated threat to Iran on social media.