U.S. President Donald Trump said Wednesday that the war with Iran could end immediately after the Nov. 3 midterm elections, while signaling possible diplomatic openings on both Tehran and the war in Ukraine.

Speaking to reporters before traveling to Dallas, Texas, for the Republican Party's first midterm convention, Trump claimed Iran was seeking to influence the elections and could not sustain the conflict much longer.

"I think the war will end immediately after the election because they can't hold out any longer," Trump said.

Asked about the possibility of renewed nuclear negotiations with Tehran, Trump said his administration was not actively pursuing talks but did not rule them out.

"We're not looking for it. Yes, a negotiation could possibly happen, but it's not something we're looking at," he said.