Iran's President Hassan Rouhani said the top foreign policy priority for his new government was to protect the nuclear deal from being torn up by the United States.

"The most important job of our foreign minister is first to stand behind the JCPOA and not to allow the US and other enemies to succeed," Rouhani told parliament on Sunday, using the technical name for the 2015 agreement that eased sanctions in exchange for curbs to Iran's nuclear programme.

"Standing up for the JCPOA means standing up to Iran's enemies," he said on the last day of debates over his cabinet selections.

Rouhani indicated a week ago that Iran was ready to walk out on the nuclear deal if the US continued to apply new sanctions.

READ MORE: Iran unveils new missile production line

US President Donald Trump repeatedly threatened to tear up the deal during his election campaign, and it has come under mounting pressure after Tehran carried out missile tests and Washington imposed new sanctions - with each accusing the other of violating the spirit of the agreement.

But Rouhani has insisted it remains Iran's preferred way forward, not least to help rebuild the struggling economy and create jobs.

"The second responsibility of the foreign ministry ... is to get involved in economic activities. It should help attract foreign investment and technology," Rouhani said, adding Iran needed $200bn in investments for the oil and gas sector alone.

Parliament approved 16 of his 17 cabinet picks, rejecting his suggested minister of energy, a reformist named Habibollah Bitaraf.

Foreign Minister Mohammad Javad Zarif, the charismatic face of Iran's nuclear negotiations, retained his position.

READ MORE: Iran deal will haunt the Middle East in the future

So did Oil Minister Bijan Namdar Zanganeh who recently struck a billion-dollar deal with French giant Total.

Rouhani, a political moderate, worked hard behind the scenes to secure support for his choices, including from the supreme leader and the military.

He began his second term earlier this month after winning a resounding victory over a hardline challenger in May, vowing to continue his outreach to the world and improve civil liberties at home.

But he has angered reformists by again failing to appoint a single female minister and looks no closer to securing the release of jailed opposition leaders - one of whom, Mehdi Karroubi, briefly went on hunger strike last week to demand a trial after six years under house arrest.

Rouhani has yet to appoint a minister of science, research and technology, which conservatives consider to be a sensitive post.