Khamenei, posting on his official website, said: "In the recent days' incidents, enemies of Iran utilized various means - including money, weapon, politics and intelligence apparatuses - to create problems for the Islamic system", he said.
People there are openly critical of Iran's religious government, which they consider useless and corrupt.
Unlike the unrest in 2009, the protests appear to be spontaneous without any clear leadership which has posed a bigger challenge for the government. It is not at the moment, so that will make it harder for the protests to be sustained, and they may run out of steam.
"We call on the Iranian authorities to uphold and respect democratic and human rights", a spokesman for Foreign Affairs Minister Chrystia Freeland said Tuesday.
At least 21 people died and more than 400 were arrested in nationwide protests that began December 28, Iranian media reported. But while Iran received billions of dollars as a result of the agreement, much of it went to the powerful Revolutionary Guard and helped pay for Iran's military campaign in Yemen and for Hezbollah's defense of Syria's regime in that country's brutal civil war.
European Union foreign policy chief Federica Mogherini late Tuesday deplored "the unacceptable loss of human lives" and called on "all concerned to refrain from violence". At least 21 people have been killed.
On Sunday, Rouhani said Iranians have the right to protest, but said violence would be met with a firm response. They seek freedom. They seek justice. "This is nothing", Rouhani said in a meeting with Iranian MPs.
People stand near a burning auto in Tuyserkan, Hamadan Province, Iran, December 31, 2017 in this still image taken from video.
On Tuesday, US envoy to the UN Nikki Haley branded as "complete nonsense" Iran's suggestion that external enemies were fomenting the unrest.
"We do have some freedom in Iran", Hamid Rahimi, a 33-year-old bank employee, told AFP. Dozens have already been killed.
Trump's Address to Farm Bureau: 'Farm Country Is God's Country'
While discussing the estate tax, Trump requested the crowd "get up" to give him a standing ovation . We are moving into yet another year of economic difficulty. "Make money doing it".
Hundreds of people have been arrested following the clashes.
Khamenei said he would elaborate further in the coming days. "It's natural; we have to solve the problems", Rouhani said.
Regional rivals of Iran and the Western powers are looking at the protests with a hope that it could lead to regime change in the country.
Many Tehranis agreed with his assessment. More than 3 million Iranians are jobless, and youth unemployment is about 40 percent.
But he also understood the economic grievances driving the unrest. Numerous protesters appear to be poor, unemployed people who are struggling to feed their families.
Pro-regime rallies were held across several towns and cities - reflecting continued support among a large conservative section of society.
The head of Tehran's revolutionary court, Moussa Ghazanfarabadi, warned that as violence grows punishments for demonstrators would get "heavier".
Rural areas, hit by years of drought and under-investment, are particularly hard-hit. People thronged the streets against alleged election fraud by the then President.
The demonstrations have seen six days of unrest across the nation and a death toll of at least 20.