LONDON — Iran will not negotiate with the United States over its nuclear and missile programs, Supreme Leader Ayatollah Ali Khamenei said on Wednesday, after President Hassan Rouhani signalled talks with Washington might be possible if sanctions were lifted.

Washington withdrew last year from an international nuclear deal signed with Tehran in 2015, and it is ratcheting up sanctions in efforts to shut down Iran’s economy by ending its international sales of crude oil.

President Trump condemned the accord, signed by his predecessor, Barack Obama, as flawed for not being permanent and for not covering Iran’s ballistic missile program and its role in conflicts around the Middle East.

Mr. Trump said on Monday that he was hopeful Iran would come to the negotiating table to reach a new deal. “I really believe that Iran would like to make a deal,” he said.