(CNN) President Donald Trump worked to project party unity and forward momentum during a political rally in Elkhart, Indiana, on Thursday night after a bitter GOP primary battle in the state earlier this week.

But from the beginning of his speech, and peppered throughout, Trump hailed his recent foreign policy accomplishments, including securing the release of three American prisoners from North Korea, and railed against the Iran nuclear agreement, which he opted to exit earlier this week.

"America is being respected again," Trump proclaimed to cheers inside a packed middle school gymnasium.

He said the relationship between the US and North Korea was "good" and previewed the planned summit in Singapore between himself and North Korean leader Kim Jong Un.

"You remember everybody in the fake news, when they were saying he's going to get us into a nuclear war?" he said to boos. "And you know what gets you into nuclear wars, and you know what gets you into other wars? Weakness."

Campaigning against Donnelly

Trump traveled to Elkhart two days after former state Rep. Mike Braun secured his place on the November ballot against the vulnerable Democratic incumbent Sen. Joe Donnelly. Braun beat out two sitting congressmen in a surprise upset.

For Trump, the rally provided an opportunity to hit at Donnelly, who represented a district that included Elkhart during his time in the US House.

Trump railed against Democrats and Donnelly in particular, and he brought out Braun to address the crowd.

"We need Mike Braun in the Senate," Trump said, adding later, "Now if Joe Donnelly, Sleepin' Joe, and the Democrats get back into power, remember what I said, they will raise your taxes. ... They will destroy your jobs, and they are going to knock the hell out of your borders."

Trump took issue with Donnelly's voting record and dinged his vote for "failed Obamacare."

Trump teased something new on health care soon and touted the repeal of the law's individual mandate last year.

"Wait till you see the plans we have coming out literally over the next four weeks," he said. "We have great health care plans coming out."

Trump is expected to assume a larger role on the campaign trail in coming months as Republicans work to retain control of the House and Senate.

Donnelly responded in a statement that Trump and Vice President Mike Pence were there "for politics" and included statistics on his own voting record, saying he had voted with Trump 62% of the time and had 41 proposals become law since 2013.

"I don't work for any president or any political party," his statement read. "I work for Hoosiers, and that will never change."

During Thursday night's speech, Trump also hailed economic improvements in the country -- a potent topic in Elkhart, which then-President Barack Obama visited in 2009 only days into his term. Obama returned to the town, a hub of recreational vehicle manufacturing, in 2016.

"Here at home, the great news keeps rolling in," Trump said. "3.3 million new jobs since the election."

But returning to his election theme, he warned that the gains he claimed would be reversed if voters went against his party.

"The strides that we're making have never, ever, been made like this before," Trump said. "But it can also disappear if you put fools and if you put the wrong people in. It can disappear."

'Hope' for a deal with Iran

On the Iran front, Trump lashed out against the multiparty deal agreed to by Obama, and envisioned crafting a new, lasting agreement with Iran.

"I hope to be able to make a deal with them, a good deal, a fair deal, a good deal for them, better for them, better for them," he said. "But we cannot allow them to have nuclear weapons."

Trump repeatedly brought up a legal settlement the US had made with Iran during the Obama administration and claimed the money was in exchange for US hostages.

The payments to Iran were a point of contention at the time, with Republicans accusing the Obama administration of making the payments in exchange for the hostages' release. Obama denied the payments were ransom, calling them a transparent matter and pointedly saying, "We do not pay ransom."

Nevertheless, Trump compared his administration favorably in reference to the American prisoners who North Korea returned to the US this week.

"With respect, we didn't pay for them," Trump said.