Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

TEHRAN — The recent missile attack on U.S. troops in Iraq dealt a “blow to America’s image,” Iran's supreme leader said Friday as the government grappled with the fallout of the killing of a top general by the United States and scrambled to contain anger at the subsequent accidental downing of a passenger plane.

"They stealthily and cowardly assassinated Gen. [Qassem] Soleimani," Ayatollah Ali Khamenei told the huge crowd, according to a translation by state-owned Press TV.

Khamenei also slammed Britain, France and Germany for triggering an official dispute clause Tuesday in the landmark 2015 nuclear deal.

“After the U.S. exited the deal, I told you back then that these three are not trustworthy,” he said, leaving open the door to future negotiations — just not with Washington.

President Donald Trump pulled out of the agreement in May 2018 and reimposed crippling sanctions on the country.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Earlier, Iranians flooded the streets outside Tehran's Mosalla Mosque to hear Khamenei, 80, address Friday prayers for the first time since 2012. Wrapped up against the cold, some carried pictures of the supreme leader while others held aloft placards telling the U.S. to “Pack up and get lost.” The crowds quickly filled the inner hall of the mosque with many spilling out onto the streets.

Khamenei's decision to speak indicates how seriously authorities are taking recent events, particularly the downing of the Ukrainian plane that killed 176 people aboard, including 82 Iranians.

Download the NBC News app for breaking news and politics

The supreme leader described the downing of the passenger jet as a “horrible tragedy” that “truly saddened the Iranian nation” but blamed the "enemy" for trying to capitalize on the incident.

“The enemy became so happy with the unintentional downing of the plane because they had thought that they found a pretext to destroy Iran’s image, but they will certainly fail,” he told the crowds.

The last time Khamenei, who has the final say on major decisions in Iran, spoke at Friday prayers was eight years ago at a service to mark the 1979 revolution that overthrew Shah Mohammad Reza Pahlavi.

Now Iran is reeling from the death of Soleimani, who was killed when a U.S. drone targeted his motorcade in Baghdad on Jan. 3. Less than a week later, Iran launched a barrage of ballistic missiles targeting U.S. troops in Iraq. Nobody was killed in the attack but it ramped up tensions with the U.S.

The Pentagon said Thursday that several U.S. service members were treated for concussions after the attack and are still being assessed.

As Iran’s Revolutionary Guard braced for an American counterattack, it mistakenly shot down the Ukrainian passenger plane shortly after it took off from Tehran. Iran initially denied that a missile had struck the plane last Wednesday, only to reverse course Saturday and admit that it had shot it down by accident.

Many students and middle-class Iranians took to the streets in protest. In Tehran, some students refused to trample on paintings of U.S. and Israeli flags in an apparent rejection of the government’s attempts to deflect blame.

Amin Hossein Khodadadi reported from Tehran, and Saphora Smith reported from London.