The U.S. and Iran agreed to stop attacks on Sunday, a U.S. official said.