The president said on social media that his administration “is in serious discussions” with Iran to end military operations.