Iranian President Hassan Rohani, who was sworn-in for a second term on Saturday, has accused the United States of trying to undermine Tehran's nuclear deal with world powers, telling President Donald Trump that it will be his political suicide.

Rohani, who was decisively re-elected in May after promising to open Iran to the world, took the oath of office before parliament in Tehran in the presence of foreign dignitaries including senior European figures.

"The U.S. lack of commitment to implementation of the nuclear deal ... proved it to be an unreliable partner to the world and even to its longtime allies," Rohani said in a ceremony broadcast live on state television.

The deal he championed with the United States and five other major powers in 2015 led to the lifting of most sanctions against Iran in return for curbs on its nuclear program.

Rohani has intensified efforts to protect the deal - the biggest achievement of his first term - against Washington's return to an aggressive Iran policy.

In comments aimed at Trump, Rohani said: "Those who want to tear up the nuclear deal should know that they will be ripping up their own political life."

The U.S. Senate voted in late July to impose new sanctions on Iran over its missiles program and human rights issues.

"Iran would not be the first to pull out of the nuclear deal, but it will not remain silent about the U.S. repeated violations of the accord," Rohani said.

Praise for European presence

In a meeting with European foreign policy chief Federica Mogherini in Tehran in advance of the ceremony, Rohani said the U.S. stance could hamper implementation of the nuclear deal.

Praising the presence of senior European dignitaries at the ceremony, Rohani said it showed Europe was determined to expand ties with Tehran.

Iranian Foreign Minister Mohammad Javad Zarif was also quoted as saying by state media in his meeting with Mogherini: "Mr. Trump is trying to destroy the nuclear accord at Iran's expense, and Europe should be conscious of this."

Russian Deputy Prime Minister Dmitry Rogozin, President of Iraq Fuad Masum, Afghan President Ashraf Ghani and Zimbabwe's President Robert Mugabe were also present at swearing-in ceremony.

Among the Western officials present were French Foreign Minister Jean-Yves Le Drian, State Secretary at the German Foreign Ministry Michael Roth, and British Minister of State Alistair Burt.

Security in Tehran was increased to the highest level, the police said, two months after gunmen linked to the Islamic State group attacked parliament and the mausoleum of Ayatollah Ruhollah Khomeini, killing 17 people.

Rohani's deputy said on Wednesday that Rohani would keep on two important ministers for his second term: Oil Minister Bijan Zanganeh and Foreign Minister Zarif.

The powers of the elected president are limited by those of the unelected Supreme Leader who outranks him, but the scale of Rohani's victory can give the pragmatist president a strong mandate.

However, analysts say Rohani may struggle to make a significant impact given sharpening divisions in the dual clerical-republican power structure in Iran, and Trump's aggressive policy against Tehran.