"Once again, the nation tells the US, Britain, and those who seek to overthrow the Islamic Republic of Iran from abroad that 'you've failed, and you will fail in the future, too,'" Khamenei wrote on his Twitter page.
He added that all the moves of hostile nations against Tehran over the past 40 years were "attacks on the Islamic Revolution."
The Iranian leader also shared his vision of the reasons behind demonstrations in the country, stressing that it was a US-Israeli scheme funded by a Persian Gulf state.
"According to evidence of intelligence, there's been a triangle pattern activating these events. The scheme was formed by U.S. & Zionists. The money came from a wealthy government near the Persian Gulf; the 3rd element were the henchmen. The butchers, MEK, were hired as minions for this plot," Khamenei said.
At least 20 people have reportedly been killed and 450 have been detained. Interior Minister Abdolreza Rahmani Fazli said that about 42,000 Iranians had participated in the rallies.