LONDON — Ayatollah Ali Khamenei, the Iranian supreme leader, blamed “enemies” of Iran on Tuesday for protests that have left more than 20 people dead, in his first comments since the unrest started last week. “In recent events, enemies of Iran have allied & used the various means they possess, including money, weapons, politics & intelligence services, to trouble the Islamic Republic,” said a post in English on Ayatollah Khamenei’s Twitter account. “The enemy is always looking for an opportunity & any crevice to infiltrate & strike the Iranian nation.” As of Tuesday morning, the death toll from the protests across the country and the ensuing crackdown by the government and security services was at least 21. About 450 people had been taken into custody in the capital, Tehran, alone, according to the semiofficial news agency ILNA, and arrests have also been reported elsewhere. Ayatollah Khamenei, who has been a target of the protesters, did not specify which individuals or countries he was referring to, saying he would “speak to the dear people when the time is right.” In his stream of posts on Twitter, he did, however, implicitly compare the current demonstrations to Iran’s eight-year war with Iraq in the 1980s, when the United States, its European allies and the Persian Gulf monarchies of Saudi Arabia and the United Arab Emirates backed the Baath Party government of Saddam Hussein against Tehran. Continue reading the main story “During Saddam’s imposed war on #Iran, If the Ba’thi enemies had entered Iran, they would show no mercy towards anything or anyone,” Ayatollah Khamenei wrote in another tweet. “Iran’s situation would be worse off than today’s #Libya or #Syria.” The United States, Saudi Arabia and the other Persian Gulf monarchies are all backing the rebels fighting the Iranian-backed government in Syria. In Libya, NATO led a bombing campaign that helped remove Col. Muammar el-Qaddafi in 2011, and both the United Arab Emirates and Qatar have continued to back allied groups inside Libya in the continuing civil strife there. “The Iranian nation will forever owe the dear martyrs, who left behind their homes and families, to stand against the wicked enemies backed by westerners, easterners, as well as reactionaries of the region,” Ayatollah Khamenei wrote, apparently in another reference to the Iran-Iraq war. His remarks came a day after President Trump criticized Iran, saying the country’s leaders had repressed their people for years. Mr. Trump again addressed the situation there on Tuesday, in another Twitter post that appeared shortly after the supreme leader’s, in which he expressed solidarity with the Iranian people, even though he has sought to prevent them from entering the United States.