Thousands have taken to the streets of cities across Iran, beginning on Thursday in Mashhad, the country's second-largest city and a holy site for Shiite pilgrims.
"Some meant to enter and damage some government places but the attackers did not manage to achieve their goals. and the town is under control", the unidentified official told the ILNA news agency.
The unauthorized protests have challenged authorities, with crowds turning revolutionary slogans against the government of the Islamic Republic, which took power after a revolution in 1979.
"This is not like anything I have seen before, there are people from everywhere, protesting against everything" said Layla, a young media professional.
The outpouring of public discontent - the most widespread since protests following Iran's disputed 2009 presidential election -have been fanned by messages sent on the Telegram messaging app, which authorities blocked Sunday along with the photo-sharing app Instagram, which is owned by tech giant Facebook.
The Iranian government did not immediately comment.
The Mehr news agency reported Sunday that the two protesters were killed in Doroud, in Iran's Lorestan province.
Iranian Communications Minister Mohammad-Javad Azari Jahromi had earlier accused channels like Amadnews of promoting "armed uprising and social unrest".
The Iranian president said that Iranian citizens were "completely free to express their criticism of the government or stage protests.in a way that would lead to the improvement of the country's conditions".
Authorities said Iranian security forces were not responsible for the deaths and instead blamed Sunni Muslim extremists and foreign actors.
Violence flared in many places on Saturday, and videos posted online suggest demonstrations have continued in a dozen or more cities on Sunday. "Oppressive regimes can not endure forever, and the day will come when the Iranian people will face a choice".
The protests have been the biggest show of dissent since huge rallies in 2009.
The protests have erupted at a time of deepening strains between Iran and the administration of U.S. President Donald Trump, who has imposed additional sanctions on Tehran and has threatened to scuttle the nuclear accord.
"This man, who is an enemy of the Iranian nation from the top of his head to his very toes, has no right to sympathise with Iranians", he added.
Iranians said the app is now inaccessible by mobile phone networks. "We pray that freedom and human rights will carry the day".
Rouhani pushed back on Trump's remarks, saying that he had no right to sympathize with protesters because he "called the Iranian nation terrorists a few months ago".