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