ISTANBUL — Iran said Sunday that it is suspending its commitments under the 2015 nuclear deal it had struck with world powers and will abandon the accord's "final restrictions" on uranium enrichment and other activities unless U.S. sanctions are lifted.

The government announced the move in a statement carried by state news agencies.

"Iran's nuclear program will now be based solely on its technical needs," the statement said. The move includes breaching the deal's caps on uranium production and enrichment capacity, as well as nuclear research and development. 

"If the sanctions are lifted . . . the Islamic Republic is ready to return to its obligations," the statement said. It added that Iran will continue to cooperate with the International Atomic Energy Agency, the United Nations' nuclear watchdog.

The announcement came as the region continued to grapple with the fallout of a U.S. drone strike that killed Maj. Gen. Qasem Soleimani, commander of Iran's elite Quds Force, as he traveled in a convoy near the Baghdad airport Friday. The strike also killed a key Iraq militia leader, Abu Mahdi al-Muhandis.

Iraq’s caretaker prime minister urged parliament on Sunday to take “urgent measures” to force the withdrawal of foreign forces following the strike. In an address to the legislature, Adel Abdul Mahdi recommended that the government establish a timetable for the departure of foreign troops, including the members of the U.S.-led coalition fighting the Islamic State militant group, “for the sake of our national sovereignty.”

“What happened was a political assassination,” Abdul Mahdi said.

Lawmakers responded by passing a nonbinding resolution calling on the government to end the foreign troop presence in Iraq. But Abdul Mahdi, who resigned in November and has been serving in a caretaker role, is not legally authorized to sign the bill into law.

As a result, the vote Sunday did not immediately imperil the U.S. presence in Iraq, but it highlights the head winds the Trump administration faces after the strike, which was seen in Iraq as a violation of sovereignty and as a dangerous escalation by governments across the Middle East.

Speaking to reporters on Air Force One, President Trump said the United States would put “very big sanctions on Iraq” if the country forced out U.S. troops.

“If they do ask us to leave, if we don’t do it in a very friendly basis. We will charge them sanctions like they’ve never seen before ever,” Trump said. “It’ll make Iranian sanctions look somewhat tame.”

Trump also warned that he expected Iraq to compensate the United States for an air base there.

“We have a very extraordinarily expensive air base that’s there,” Trump said. “It cost billions of dollars to build. Long before my time. We’re not leaving unless they pay us back for it.”

In a sign of the spiraling consequences, the U.S.-led coalition said it had paused its training mission in Iraq because of “repeated rocket attacks over the last two months” by the Iran-backed Kataib Hezbollah militia. It will now focus on protecting its bases from attack, the coalition said in a statement.

“This has limited our capacity to conduct training with partners and to support their operations” against the Islamic State, it said. “We have therefore paused these activities.”

But in appearances on morning talk shows Sunday, Secretary of State Mike Pompeo dismissed calls for U.S. troops to leave Iraq, saying on “Fox News Sunday” that Abdul Mahdi is “under enormous threats from the very Iranian leadership that it is that we are pushing back against.”

“We are confident that the Iraqi people want the United States to continue to be there to fight the counterterror campaign,” Pompeo said. “And we’ll continue to do all the things we need to do to keep America safe.”

State Department spokeswoman Morgan Ortagus said Washington was “disappointed” by the Iraqi lawmakers’ move, and urged them to reconsider as the United States seeks “further clarification on the legal nature and impact of today’s resolution.”

“We believe it is in the shared interests of the United States and Iraq to continue fighting ISIS together,” she said, using an acronym for the Islamic State.

Iran, meanwhile, said Sunday that it will limit its response to the drone attack to U.S. military targets.

“The response for sure will be military and against military sites,” Hossein Dehghan, the military adviser to Iran’s supreme leader, said in an interview with CNN. “The only thing that can end this period of war is for the Americans to receive a blow that is equal to the blow they have inflicted.”

In an interview with Iranian state television aired Monday, Ismail Qaani, the general who replaced Soleimani as commander of Iran’s Quds Force, vowed to avenge his predecessor’s death.

On Monday, millions clad in black flooded the streets of Iran’s capital, where a ceremony for the dead was held. Ayatollah Ali Khamenei, Iran’s supreme leader, led prayers in perfect Arabic, choking on his words as he stood by coffins covered in the Iranian flag — save one in the black, red, white and green of the Iraqi flag, where Muhandis likely lay.

Yemen’s city of Saada, held by the Iran-allied Houthis, also exploded with millions of mourners filling the streets and protesting the strike that killed the Iranian and Iraqi symbols.

Trump meanwhile threatened Saturday on Twitter to strike “52 Iranian sites . . . some at a very high level & important to Iran and the Iranian culture” should Tehran retaliate against Americans or U.S. interests in the region. Iran has 24 locations on the U.N. list of cultural world heritage sites.

If Trump were to carry out his threats, Dehghan said, “no American military staff, no American political center, no American military base, no American vessel will be safe.”

Trump later tweeted: “These Media Posts will serve as notification to the United States Congress that should Iran strike any U.S. person or target, the United States will quickly & fully strike back, & perhaps in a disproportionate manner.”

“Such legal notice is not required, but is given nevertheless!” he wrote.

The Iraqi military said late Sunday that six rockets had landed in Baghdad, including three inside the Green Zone, a fortified neighborhood housing many foreigners and the U.S. Embassy.

A U.S. diplomat said rockets apparently hit a vehicle lot in the embassy compound.

Hassan Nasrallah, the leader of Lebanon’s Hezbollah movement, echoed Dehghan’s statement, declaring Sunday that as retribution for Soleimani’s death, U.S. troops in the Middle East, and not U.S. civilians, should be targeted.

“It is the U.S. military that killed Haj Qasem, and they must pay the price,” Nasrallah said, referring to Soleimani. “Touching any civilian anywhere in the world will only serve Trump’s policy.”

U.S. allies widely share concerns about the consequences of Soleimani’s death. NATO will convene an emergency meeting of its ambassadors Monday to discuss the situation in Iraq. NATO suspended its training programs in the country, and several member nations have scrambled to protect their troops and citizens there.

In Saudi Arabia, the U.S. Embassy released a security alert Sunday advising Americans of “the heightened risk of missile and drone attacks” against both civilian and military targets.

The United States blamed Iran for a drone and cruise missile attack on Saudi state oil facilities in September, a strike that knocked half of the nation’s oil production offline.

While Saudi officials have long urged the United States to take stronger action against what they say is Iran’s unchecked expansionism in the region, they have also expressed discomfort at the rising tensions between Washington and Tehran.

Abdul Mahdi suggested Sunday that Iran and the Saudis had been engaged in dialogue to tamp down their feud, with Iraq playing the role of mediator. Abdul Mahdi said he had been expecting to meet with Soleimani on the day he was killed. “He came to deliver me a message from Iran, responding to the message we delivered from Saudi Arabia to Iran,” the prime minister said, without providing details.

On Sunday, Soleimani’s body was flown in a flag-draped coffin to the southwestern Iranian city of Ahvaz, following a funeral procession in Baghdad and Iraq’s twin Shiite shrine cities, Karbala and Najaf. It was later carried to the northeastern city of Mashhad, home to the shrine of Imam Reza, a revered figure in Shiite Islam. Iran is ruled by a Shiite theocracy.

Footage broadcast on Iranian state television showed tens of thousands of black-clad mourners waving flags and chanting religious slogans. Iran’s state-run Islamic Republic News Agency described the scene as “glorious.”

“All schools and businesses are closed today — he was popular here and even more popular now,” said Farnaz, 33, a computer engineer and resident of Ahvaz, referring to Soleimani. Like other Iranians contacted Sunday, she spoke on the condition that her full name not be used so she could speak freely.

“People here . . . saw Soleimani as an important and charismatic commander who was protecting their security,” she said.

Still, Ahvaz and other cities in oil-rich Khuzestan province, home to a large ethnic Arab minority, have a history of anti-government unrest. On Sunday, an unverified video posted online showed masked youths setting fire to a billboard commemorating Soleimani.

Soleimani will be buried in his hometown, Kerman, on Tuesday.

Mustafa Salim in Baghdad, Kareem Fahim in Istanbul, Michael Birnbaum in Antwerp, Belgium, and Siobhán O’Grady, John Hudson and Marisa Iati in Washington contributed to this report.