Iran has given European leaders a 60-day deadline to find a way to shield it from US sanctions targeting its economy, or else they would begin to enrich uranium closer to weapons-grade levels.
Rouhani said Iran wanted to negotiate new terms with remaining partners in the deal, but acknowledged that the situation was dire.
The Pakistan Prime Minister admitted of terrorists using Pakistani soil against Iran during a joint press conference with Iranian President Hassan Rouhani last week.
Islamabad had said it had evidence the 'terrorist outfits' that carried out the attack in Balochistan had 'training and logistic camps inside Iranian areas bordering Pakistan.'
Rouhani's visit to Iraq will be the first since he became president in 2013.
Wednesday's attack, which targeted a busload of Revolutionary Guards in the volatile southeastern province of Sistan-Baluchistan, was one of the deadliest on Iranian security forces in years.
The appointment of Kambiz Mehdizadeh, in his early thirties and reportedly married to Rouhani's daughter in a low-key wedding this August, was widely criticised by Iranians on social media.
Tensions have risen between Iran and the United States after US President Donald Trump withdrew from a multilateral nuclear deal in May and reimposed sanctions on the Islamic Republic.
He made the remarks at the 32nd International Islamic Unity Conference which kicked off in the capital Tehran earlier in the day.
Rouhani said the United States cultivates close ties with regional Muslim nations to protect Israel, an apparent reference to Iran's regional rival Saudi Arabia and the kingdom's Sunni Arab allies.
Khashoggi, a government critic who was living in self-imposed exile in the United States, was murdered inside the Saudi consulate in Istanbul on October 2 as he organised the paperwork for his marriag
The US is due to complete the reimposition of sanctions on November 5, targeting Iran's oil sector and central bank.
The United States has moved to reimpose sanctions that had been lifted under the landmark deal to curb Iran's nuclear program and has vowed to punish foreign firms that do business with Iran.
"I am starting the dialogue right here, and state, in unequivocal terms, that the question of international security is not a toy in American domestic politics."
In the immediate aftermath of the attack on Saturday, Iranian authorities said they suspected Arab separatist groups were behind the attack, none of whom is known to have a presence in Syria.