Iran was rocked by protests this week that pit protesters angry with the country's economic downturn against pro-government hardliners.

The demonstrations began Thursday, when protesters took to the streets to criticize Iran's government and the skyrocketing prices of basic necessities.

The protests are the largest in Iran since the 2009 Green Movement.

Two demonstrators died overnight, and Iran is now blocking social media apps like Instagram.

On Sunday, Iran blocked access to Instagram and a popular messaging app used by activists to organize and publicize the protests now roiling the Islamic Republic, as authorities said two demonstrators had been killed overnight in the first deaths attributed to the rallies.

The demonstrations, which began Thursday over the economic woes plaguing Iran and continued Sunday, appear to be the largest to strike the Islamic Republic since the protests that followed the country's disputed 2009 presidential election.

On Saturday, a wave of spontaneous protests over Iran's weak economy swept into Tehran, with college students and others chanting against the government just hours after hard-liners held their own rally in support of the Islamic Republic's clerical establishment.

The protests in the Iranian capital and second-largest city Mashhad — as well as US President Donald Trump tweeting about them — raised the stakes. It also apparently forced state television to break its silence, acknowledging it hadn't reported on them on orders from security officials.

People protest in Tehran, Iran December 30, 2017 in this picture obtained from social media. Reuters

"Counterrevolution groups and foreign media are continuing their organized efforts to misuse the people's economic and livelihood problems and their legitimate demands to provide an opportunity for unlawful gatherings and possibly chaos," state TV said.

The protests appear sparked by social media posts and a surge in prices of basic food supplies, like eggs and poultry. Officials and state media made a point Saturday of saying Iranians have the right to protest and have their voices heard on social issues.

However, protesters in Tehran on Saturday chanted against high-ranking government officials and made other political statements, according to the semi-official Fars news agency. Hundreds of students and others joined a new economic protest at Tehran University, with riot police massing at the school's gates as they shut down surrounding roads.

Fars said protests on Friday also struck Qom, a city that is the world's foremost center for Shiite Islamic scholarship and home to a major Shiite shrine.

Social media videos purport to show clashes between protesters and police in several areas. Some videos even showed protesters chanting "Death to the dictator!" and "Death to (President Hassan) Rouhani."

At least 50 protesters have been arrested since Thursday, authorities said. State TV also said some protesters chanted the name of Iran's one-time shah, who fled into exile just before its 1979 Islamic Revolution.

2 dead, Instagram and other social media apps blocked

University students attend a protest inside Tehran University while anti-riot Iranian police prevent them to join other protestors on Saturday, Dec. 30, 2017. AP

The protests were fanned in part 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.

Many in Iran are learning about the protests and sharing images of them through Telegram, a mobile phone messaging app popular among the country's 80 million people. On Saturday, Telegram shut down one channel on the service over Iranian allegations it encouraged violence, something its moderator denied.

On Sunday, Telegram CEO Pavel Durov wrote on Twitter that authorities had blocked access to the app.

"Iranian authorities are blocking access to Telegram for the majority of Iranians after our public refusal to shut down ... peacefully protesting channels," he wrote.

A university student attends a protest inside Tehran University while a smoke grenade is thrown by anti-riot Iranian police, in Tehran, Iran on Dec. 30, 2017. AP

Iran's state TV news website, iribnews.ir, quoted an anonymous source saying that social media in Iran would be temporarily limited as a safety measure.

"With a decision by the Supreme National Security Council, activities of Telegram and Instagram are temporarily limited," the report said, without elaborating.

Facebook, based in Menlo Park, California, did not immediately respond to AP's request for comment. Facebook itself has been banned in Iran since protests against the disputed 2009 re-election of hard-line President Mahmoud Ahmadinejad. However, some in Iran access it and other banned websites using virtual private networks.

Meanwhile, authorities acknowledged the first fatalities in the protests in Doroud, a city some 325 kilometers (200 miles) southwest of Tehran in Iran's western Lorestan province. Protesters had gathered for an unauthorized rally that lasted into the night Saturday, said Habibollah Khojastepour, the security deputy of Lorestan's governor. The two protesters were killed in clashes at the rally, he said.

"The gathering was to be ended peacefully, but due to the presence of the (agitators), unfortunately, this happened," Khojastepour said.

He did not offer a cause of death for the two protesters, but said "no bullets were shot from police and security forces at the people."

The largest demonstrations in Iran since 2009

Iranian protesters chant slogans at a rally in Tehran, Iran on Dec. 30, 2017. AP Photo/Ebrahim Noroozi

Telecommunications Minister Mohammad Javad Azari Jahromi send a message by Twitter to the CEO of messaging service Telegram, Pavel Durov, saying: "A telegram channel is encouraging hateful conduct, use Molotov cocktails, armed uprising, and social unrest." Telegram responded saying it had suspended the account.

"A Telegram channel (amadnews) started to instruct their subscribers to use Molotov cocktails against police and got suspended due to our 'no calls for violence' rule. Be careful - there are lines one shouldn't cross." Durov tweeted.

The semi-official Tasnim news agency quoted the deputy commander of Tehran's Revolutionary Guard base, Brig. Gen. Ismail Kowsari, as saying: "Peace has returned to city of Tehran and its surroundings." He added that if inflation was the reason the protesters took to the streets they should not have destroyed property, according to the report.

The Semi-official ILNA news agency reported on Saturday that the security deputy of Tehran's governor, Mohsen Hamedani, said that Tehran's provincial security council held a meeting to address the protests, but that its decisions were "classified."

Earlier Saturday, hard-liners rallied across the country to support Supreme Leader Ayatollah Ali Khamenei and others. The rallies, scheduled weeks earlier, commemorated a mass 2009 pro-government rally challenging those who rejected the re-election of hard-line President Mahmoud Ahmadinejad amid fraud allegations.

State TV aired live the pro-government "9 Dey Epic" rallies, named for the date on the Iranian calendar the 2009 protests took place. The footage showed people waving flags and carrying banners bearing Khamenei's image.

In Tehran, some 4,000 people gathered at the Musalla prayer ground in central Tehran for the rally. They called for criminal trials for Mir Hossein Mousavi and Mahdi Karroubi, leaders in the 2009 protests who have been under house arrest since 2011. Iranian President Hassan Rouhani, whose administration struck the 2015 nuclear deal with world powers, campaigned on freeing the men, though they remain held.

'We must go back to the pre-nuclear deal situation'

Iranian President Hassan Rouhani. Reuters

Mohsen Araki, a Shiite cleric who serves in Iran's Assembly of Experts, praised Rouhani's efforts at improving the economy. However, he said Rouhani needed to do more to challenge "enemy pressures."

"We must go back to the pre-nuclear deal situation," Araki said. "The enemy has not kept with its commitments."

Ali Ahmadi, a pro-government demonstrator, blamed the U.S for all of Iran's economic problems.

"They always say that we are supporting Iranian people, but who should pay the costs?" Ahmadi asked.

Iran's economy has improved since the nuclear deal, which saw Iran limit its enrichment of uranium in exchange for the end of some of the international sanctions that crippled its economy. Tehran now sells its oil on the global market and has signed deals for tens of billions of dollars of Western aircraft.

That improvement has not reached the average Iranian, however. Unemployment remains high. Official inflation has crept up to 10 percent again. A recent increase in egg and poultry prices by as much as 40 percent, which a government spokesman has blamed on a cull over avian flu fears, appears to have been the spark for the economic protests.

While police have arrested some protesters, the Revolutionary Guard and its affiliates have not intervened as they have in other unauthorized demonstrations since the 2009 election. The economic protests initially just put pressure on Rouhani's administration.

Trump weighs in

Donald Trump. Jim Bourg/Reuters

Trump tweeted out support for the protests Saturday.

"The entire world understands that the good people of Iran want change, and, other than the vast military power of the United States, that Iran's people are what their leaders fear the most...." he tweeted. "Oppressive regimes cannot endure forever, and the day will come when the Iranian people will face a choice. The world is watching!"

It's unclear what effect Trump's support would have. Iranians already are largely skeptical of him over his refusal to re-certify the nuclear deal and Iran being included in his travel bans. Trump's insistence in an October speech on using the term "Arabian Gulf" in place of the Persian Gulf also has also riled the Iranian public.

Meanwhile, U.S. Secretary of State Rex Tillerson's comments in June to Congress saying American is working toward "support of those elements inside of Iran that would lead to a peaceful transition of that government" has been used by Iran's government of a sign of foreign interference in its internal politics.

The State Department issued a statement Friday supporting the protests, referencing Tillerson's earlier comments.

"Iran's leaders have turned a wealthy country with a rich history and culture into an economically depleted rogue state whose chief exports are violence, bloodshed and chaos," the statement said.

Iran's Foreign Ministry dismissed the comments.

"The noble Iranian nation never pays heed to the opportunist and hypocritical mottos chanted by the U.S. officials and their interfering allegations on domestic developments in the Islamic Republic of Iran," the state-run IRNA news agency quoted ministry spokesman Bahram Ghasemi as saying.

Trump tweeted again on Sunday morning.

"Big protests in Iran," he said. "The people are finally getting wise as to how their money and wealth is being stolen and squandered on terrorism. Looks like they will not take it any longer. The USA is watching very closely for human rights violations!"