US President Donald Trump has acknowledged that the war with Iran contributed to Republican losses in the midterm elections, agreeing with Vice President JD Vance’s assessment of the defeat, but insisted that he would make the same decision again.

Speaking to reporters on Wednesday, Trump insisited the conflict had been necessary to prevent Tehran from obtaining nuclear weapons, despite the political and economic costs.

“The Iran issue was something we had to do and we continue to do,” he said, arguing that the military operation had been worth the price.

Trump also acknowledged that rising petrol prices caused by the war had hurt Republicans at the polls, with fuel costs emerging as one of the factors behind Democratic gains.

He said he had no objection to a social media post by Vance earlier on Wednesday in which the vice-president attributed the party’s heavy electoral losses to the conflict.

Asked in regard to such an assessment, Trump said he agreed that the conflict had played a role in the result but maintained that the decision to go to war had been necessary.

“As far as this war is concerned, I wouldn’t do anything differently,” he said.

The president also claimed that Republicans would have performed better had he personally been on the ballot, saying he believed he would have won.

Trump argued that the support he received at campaign rallies had not translated into votes for Republican candidates.

“There was so much love at the campaign rallies, it was incredible, but we didn’t manage to transfer this love to the candidates,” he said.

The conflict with Iran and its impact on fuel prices had become major issues for voters, placing pressure on the administration as it defended its military campaign with Israel.

Despite acknowledging the electoral consequences, Trump maintained that preventing Iran from acquiring a nuclear weapon justified the decision to launch the war.